Migrate from ASP to ASP + ---------- to DataSet

Source: Internet
Author: User

Enter DataSet
Author: yuchen


ADO + introduces the concepts of DataSet and DataView. DataSet is similar to a set of records because it can store one or more tables of data and their relationships ). DataView is one of the implementations of these tables, similar to the ADO record set. In the above example, our DataSet only saves one table: Upcoming, which will reside in the ASP + server control. You can add more tables to DataSet in the following ways.

* Redefine our SQL statements.

* Set the SelectCommand attribute of ADODataCommand to a new ADODataCommand.

* Call the FillDataSet method of ADODataCommand

The FillDataSet method saves the tables in the SQL query results to the DataSet that is passed to the method call. Adding another table will cause the following changes:

DscUpcoming = New ADODataSetCommand (strSQL, Connect. ConnectToDB ())

DscUpcoming. FillDataSet (dsUpcoming, "Upcoming ")

Redefinition of SQL statements

StrSQL = "SELECT * FROM Students"

Set the SelectCommand attribute of ADODataSetCommand

DscUpcoming. SelectCommand = New ADOCommand (strSQL, Connect. ConnectToDB ())

Use the FillDataSet method to add the result as a new table to DataSet.

DscUpcoming. FillDataSet (dsUpcoming, "Students ")

Now we have established a connection to the database and returned the data to the DataSet. However, we have not used the data.


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.