Precautions when using CommandBuilder to update the data source for DataAdAper!

xiaoxiao2021-03-06  90

1. The primary key must be included in the SelectCommand!

2. When populating the data set, use the following method:

Da.fillschema (DS, Schematype.Source, "TableName"); // Loading table architecture Note Da.Fill (DSPUBS, "TableName"); // Load Table Data

3. DataAdapter's MissingsChemaAction property is set to AddWithKey

4. When constructing a CommandBuilder object, incorporate the DataAdapter object as a constructor parameter:

Sqlcommandbuilder objcommandbuilder = new SQLCommandbuilder (DA);

5. Increase rows, modify lines, delete rows;

6. Call the DataAdapter's Update method to update the data source!

7. Update the data source successfully, call the DS's AcceptChanges () method, update the dataset!

转载请注明原文地址:https://www.9cbs.com/read-122383.html

New Post(0)