Dataadapter is used to fill a dataset. To fill in a dataset, you must set the selectcommand attribute of the dataadapter object before calling the fill method of the dataadapter object. Other attributes, such as insertcommand, updatecommand, and deletecommand, must be set before the dataadapter object calls the update method. When using the update method to modify the data source, use the command attribute to modify the record. The modified information is maintained in the dataset. This information is transmitted to the parameters set and command object at one time.
The updatecommand. commandtext attribute of oledbdataadapter is used to reference an SQL statement or stored procedure for updating data in the database. This attribute is a common attribute used to obtain or set an SQL statement or stored procedure. Like the insertcommand attribute, the oledbdataadapter object uses the updatecommand attribute when calling the update () method.
Note that if you do not set the updatecommand attribute when calling the update method on a daily basis, you can use oledbcommandbuilder to automatically generate this attribute by using the change information stored in the dataset.
Therefore, you can set the updatecommand attribute or automatically generate this attribute.