Conversion example between able and DataSet in ASP. NET

Source: Internet
Author: User

DataSet contains multiple able and constraints between DataTable.
If you do not need to map the relationship between your data, it is more efficient to directly use DataTable. If a relational query such as 1: N or N: M is required, fill in all the corresponding datatables in DataSet, and then use the relational query data.

The DataSet data source can be viewed as a database, and the DataTable is a table in the database.

Add a able to DataSet:

When the DataTable cannot be directly converted to DataSet in the project,

New
You can add new DataSet c first and then fill it in.
DataSet ds = new DataSet ();
DataTable dt = new DataTable ("MERs ");

Ds. Tables. Add (dt );

Read a DataTable in DataSet:

Dt = ds. Tables [0]; // specify 0th Tables

Dt = ds. Tables ["MERs"]; // specify a table named "Customers"

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.