将数据绑定到ASP.Net中的GridView [英] Binding data to GridView in ASP.Net

查看:94
本文介绍了将数据绑定到ASP.Net中的GridView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要将数据绑定到数据绑定控件,例如gridview,有两种方式



1.不使用数据源控件

2.使用数据源控件。



哪个是最好的方法?哪个用于实时项目?

告诉我回答。



谢谢

Reddy Ankireddy

班加罗尔。

解决方案

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



2.在我看来,最好的方法是使用 DataSource ,因为这样你就不需要额外的编码来与<$ c集成$ c> GridView 控制,这样你就会有时间。你可以在我的下一篇文章中找到一个以这种方式使用的例子:高级ASPX GridView分页和数据实体 [<小时ef =http://www.codeproject.com/Articles/123095/Advanced-ASPX-GridView-Pagination-and-Data-Entitietarget =_ blanktitle =New Window> ^ ]



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[^]


这篇关于将数据绑定到ASP.Net中的GridView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆