我对ASP.net相对较新,在学习它时,我遇到了人们用来将数据绑定到GridView的不同方式:
首选哪种方式以及在什么情况下?
谢谢
答案 0 :(得分:2)
这取决于要求。但是ObjectDataSource
和Binding DataTable to GridView control from the code behind
比SqlDataSource
更好。当你使用linq或MVC然后首选ObjectDataSource
而对于多层架构,ASP.NET更喜欢Binding DataTable to GridView control from the code behind
,
我希望你能得到答案。