简体   繁体   English

ASP.NET数据源控件

[英]ASP.NET Data source controls

I am learning ASP.NET. 我正在学习ASP.NET。 I noticed there are several types of ASP.NET data source controls available in Microsoft Visual studio, including SqlDataSource, AccessDataSource, ObjectDataSource, and XmlDataSource. 我注意到Microsoft Visual Studio中提供了几种类型的ASP.NET数据源控件,包括SqlDataSource,AccessDataSource,ObjectDataSource和XmlDataSource。 Does anyone could explain the differences among SqlDataSource, AccessDataSource, ObjectDataSource, and XmlDataSource? 有谁能解释SqlDataSource,AccessDataSource,ObjectDataSource和XmlDataSource之间的区别? Which one is more useful in the real world? 在现实世界中哪个更有用? Thank you. 谢谢。

go through this links, it helped me. 通过这个链接,它帮助了我。 Hope it will help you too. 希望它也会对您有帮助。

Data Source Controls and Connections 数据源控件和连接
ASP.NET Data Sources ASP.NET数据源

I used sqldatasources a little, but now, just use entity framework. 我稍微使用了sqldatasources,但是现在,仅使用实体框架。 I was (still am) getting data from a sql db. 我(仍然是)从sql数据库获取数据。

mrqyue, You can try this mrqyue,你可以试试这个

This will explain more clearly about what you are looking for.. 这将更清楚地说明您要查找的内容。

Moreover, try this . 此外,请尝试 It will explain with examples 它将举例说明

You choose XMLDataSource if you connect to an XML file. 如果连接到XML文件,则选择XMLDataSource。 You choose AccessDataSource if your source of data is from Access database. 如果您的数据源来自Access数据库,则选择AccessDataSource。 You choose SqlDataSource if you connect to any data source that has an ADO.NET data provider (SQL Server, Oracle, OLEDB, ODBC). 如果连接到具有ADO.NET数据提供程序(SQL Server,Oracle,OLEDB,ODBC)的任何数据源,则选择SqlDataSource。 You choose ObjectDataSource if you want to connect to a custom object to fetch/take data from the database (a very efficient way for a medium-to-large application). 如果要连接到自定义对象以从数据库中获取/获取数据,则选择ObjectDataSource(对于大中型应用程序,这是一种非常有效的方法)。

Most of my projects are using N-Tier architecture and my best option is always ObjectDataSource. 我的大多数项目都使用N层架构,而我最好的选择始终是ObjectDataSource。 It gives my team a freedom to work independently, but simultaneously in one big project! 它使我的团队可以自由地独立工作,但可以同时在一个大项目中工作!

I hope it helps you. 希望对您有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM