且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将数据绑定到ASP.Net中的GridView

更新时间:2022-10-15 07:42:19

1.在实时项目中使用 DataSource 取决于可能存在的设计约束。



2.在我看来,***的方法是使用 DataSource ,因为这样你就不需要额外的编码来与 GridView 控制,这样你就会有时间。你可以在我的下一篇文章中找到一个以这种方式使用的例子:高级ASPX GridView分页和数据实体 [ ^ ]



3.如果您有兴趣查找第二种可能性的详细信息(不使用 DataSource 控件),这里是一篇好文章: http://www.binaryintellect.net/articles/66852121-52f5- 40b4-a077-eb464fa1b339.aspx [ ^ ]

To bind data to a data bound control, like gridview there are 2 ways

1. Without using data-source controls
2. Using data-source controls".

Which is best method? which one is using in real time projects?
Let me know answer.

Thank you
Reddy Ankireddy
Bangalore.

1.The using of DataSource or not in real time project depends on the design constraints that may exist.

2.In my opinion the best way is by using DataSource, because in this way you no not need extra coding for integrating with the GridView control, so you will gain time. You could find an example of using in this way in my next article: Advanced ASPX GridView Pagination and Data Entities[^]

3.If you are interesting in finding details about the 2nd possibility (not using DataSource control), here is a good article: http://www.binaryintellect.net/articles/66852121-52f5-40b4-a077-eb464fa1b339.aspx[^]