Can I Use List<> Collection Instead of Using Dataset?
My question is can i use List<> instead of dataset or datatable in asp.net using c#?Can by any means i use list<> than bind it to my gridview instead of datatable/dataset?Thank you?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Abhishek JainRank #1,062 · 1.8K reputationPosted Sep 12, 2013, 11:08 PM EDT
Create a Enitity for your Data Model or the Table
Then create a List
No give this list as a data source to the grid and the PropertyNames in this entity can be the name of the DataField in Bound Fields
Sample Code:
AJ
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Sep 12, 2013, 11:09 PM EDT
you can use List instead of dataset/datatable.
refer to this link for example:
http://www.aspsnippets.com/Articles/How-to-bind-GridView-with-Generic-List-in-ASPNet-using-C-and-VBNet.aspx
rachit sharma14 reputationPosted Sep 12, 2013, 11:41 PM EDT