Example of ASP. NET dataset usage

Source: Internet
Author: User

How is ASP. NET dataset (. xsd) used? Then, let's start our demonstration:

Datasets (. xsd) can be visualized to complete the compilation of all database operation functions, that is, complete all the contents of the DAL layer, which is very convenient. Next let's see how to use it:

ASP. NET dataset (. xsd) use 1. Create an ASP. NET Dataset:

ASP. NET dataset (. xsd) use 2. Add a TableAdapter:

 

ASP. NET dataset (. xsd) Use 3. Select database connection:

 

Use ASP. NET dataset (. xsd) 4. Select the command type:

 

ASP. NET dataset (. xsd) Use 5. Enter the SQL statement:

 

Use ASP. NET dataset (. xsd) 6. Select the method to be generated:

 

ASP. NET dataset (. xsd) is displayed on the page 7. The created method is as follows:

 

Next, let's see how to call the GetUsers method:

Program code

 
 
  1. MyDataTableAdapters.Union_UserTableAdapter dal = new MyDataTableAdapters.Union_UserTableAdapter();  
  2.  
  3. GridView1.DataSource = dal.GetUsers(11000).DefaultView;  
  4. GridView1.DataBind(); 

Note that the namespace MyDataTableAdapters is in the format of: DataSet name (MyData) + TableAdapters

The example of using the ASP. NET dataset (. xsd) is introduced here. I hope to help you understand the use of the ASP. NET dataset (. xsd.

  1. Implementation of ASP. NET data collection
  2. Use of SqlHelperSqlHelper in ASP. NET data access layer
  3. Hash Algorithm for ASP. NET Data Encryption
  4. Implement ASP. NET data encryption using symmetric encryption algorithms
  5. ASP. NET data import implementation Excel to MSSQL

Related Article

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.