DataSource series controls in ASP.net 2.0

Source: Internet
Author: User
asp.net 2.0, in which the data connection has made great improvements, the new DataSource series of controls to make the connection between the database easier, many can through the wizard-style settings to complete the writing of SQL statements and database connections. The DataSource series controls in ASP.net 2.0 total 6 species, respectively:
SqlDataSource Control----Data source control used to connect to a SQL database
AccessDataSource Control----Data source control used to connect to an Access database
The ObjectDataSource control----The data source control used to connect the custom object
Datasetdatasource Control-----A control that makes an XML file a dataset and does related processing
The XmlDataSource Control-----The control to load the XML file and bind to controls such as the DataGrid, DataList, and so on
The SiteMapDataSource control-----The control to load a predefined site layout file and then bind it to the TreeNode tree control or SiteMapPath control to make the site's page navigation easier.
 
In this article, you will focus on ObjectDataSource controls, Datasetdatasource controls, and XmlDataSource controls, and SqlDataSource controls, refer to the use of ASP.net The GridView control in 2.0, which describes how the SqlDataSource control is used, and the AccessDataSource control is similar to the SqlDataSource control, except that the connected database is access.
ObjectDataSource Control
The control that binds the objects created by the user to the data control, such as binding to Datagrid,gridview. For example, in Visual Studio 1, create a new site and add a new class named Products:
Imports Microsoft.VisualBasic
Imports System.Data
Imports System.Data.SqlClient
Public Class Products
Public Function getproducts () as DataSet
Dim Conn as New SqlConnection ("server= (local); integrated security=true;database=northwind; Persist
Security Info=true ")
Dim Adapter as New SqlDataAdapter ("SELECT [ProductID], [ProductName], [SupplierID], [CategoryID],

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.