View Ado.net through the vs.net Data Form Wizard

Source: Internet
Author: User

Some people often encounter problems with Ado.net on the Forum, especially when developing programs closely related to databases such as information management systems, there are many common problems in data and interface layer development. Next we will use the Data Form Wizard provided by vs.net to see what problems it can help us decide.

1. Use the wizard

Create a Windows application, add components for the current project, and select the Data Form Wizard. Enter DataForm1.cs as the name. Click to open the Data Form Wizard dialog box. Create a new typed dataset MyDataSet. Use the local data connection wizard. Here I select the Northwind Library as the data source.

Add the Categories table and Products table in the select table or view step. Add a relationship between tables named CategoryProductRel. In the select display style step, select the display data mode as a single record in a single control, which will bind data to the text box. You can use the data navigation bar to select the records of the parent table. After the Wizard is complete, an OleDbConnection is generated, and several tables are generated. OleDbDataAdapter is responsible for data acquisition and updating. It is also a strongly-Typed Dataset.

The running interface of the entire program is as follows:

Basic skills are included, but when you click a few times, there will be a small bug on the program interface. Microsoft may also estimate that no one will need this form to process data, but this is not what we care about.

Ii. Data Filling

Let's take a look at the dataset structure:

A Categories table is used as the parent table, the Products table is used as the sub table, and the CategoryID is the foreign key.

This topic consists of four pages, currently on page 1 2 3 4


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.