It depends on requirement. But ObjectDataSource
and Binding DataTable to GridView control from the code behind
are better then SqlDataSource
. when you use linq or MVC then Prefer ObjectDataSource
and for multi-tier architecture ASP.NET prefer Binding DataTable to GridView control from the code behind
,
I hope you will get the answer.
When using GridView, which is the best option to bind it to the datasource?
-
13-06-2023 - |
سؤال
I'm relatively new to ASP.net and while learning it I came across different ways people use to bind data to GridView:
- SqlDataSource
- ObjectDataSource
- Binding DataTable to GridView control from the code behind.
Which way is preferred and in what situations?
Thank you
المحلول
لا تنتمي إلى StackOverflow