From ASP migration to ASP + ----- enter Dataset

Source: Internet
Author: User
Tags connect
ASP + Original Author: share rain
ADO + introduced a DataSet and DataView concept. The DataSet is similar to the record set collection, because it can save one or more data and the relationship between the table (table ). A dataview is these tables, one of the implementation, similar to ADO recordset. In the example above, we DataSet to keep only a table: Upcoming, we're going to the resides ASP + in a server control. Can be one of the following ways to in the DataSet to add more tables.

* Re-define our SQL statement.

* Adodatacommand of selectcommand property is set to a new adodatacommand

* Call adodatacommand of filldataset Method

Filldataset method SQL query results to the table in the deposit to be passed to the method calls in the DataSet. Add another table will be led to the following changes:

Dscupcoming = New adodatasetcommand (strsql, Connect. connecttodb ())

Dscupcoming. filldataset (dsupcoming, "the Upcoming ")

"Re-defined SQL statement

Strsql = "" SELECT * FROM Students"

'Setting adodatasetcommand of selectcommand Properties

Dscupcoming. selectcommand = New adocommand (strsql, Connect. connecttodb ())

Using filldataset method, the results as a new watch added to A Dataset

Dscupcoming. filldataset (dsupcoming, "Students ")

Now we have already established the connection to the database and to return data in the DataSet, but we didn't use this 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.