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