P61-2.9
If you addCodeTo access the connection attribute, You can dynamically set or modify the data connection object. There are two ways to achieve this:
1. In a separate helper class;
2. In the partial class file that defines your own code written for the tableadapter class.
P63
Q: When defining a class, if you determine its namespace?
P64-2.10
Use Database transactions directly in ADO. Net:
1. Open a connection;
2. Call the begintansaction method on the connection;
3. Assign the returned transaction object to each command object. These command objects are executed as part of the transaction;
4. Call the commit method of the transaction object after the transaction operation is completed.
Summary:
1. If you can understand the data architecture during design, you should use a strong data set;
2. Put the data access code (including strong datasets) into a separate class library project, instead of forming a decoupling layered structure in the windowsforms project;
3. Drag and Drop tables, stored procedures, or views from Server Explorer to datasetdesigner to generate strong table classes and corresponding tableadapters. These tableadapters can be used to obtain and update data in a strongly typed manner from a data table. You can add a query to the tableadapter through the "add query" shortcut menu of the designer;
4. you can use the partial class to extend the partial class, such as dataset, tableadapter, table, and row, to add custom functions to these classes, and even if you need to regenerate the dataset definition, these extended functions will not be damaged.