Executes the IDbCommand for each inserted, updated, or deleted row in the DataSet also implementing RowUpdating and RowUpdated Event Handlers

Namespace: CodeSmith.Engine
Assembly: CodeSmith.Engine (in CodeSmith.Engine.dll) Version: 6.0.0.0 (7.0.0.15127)

Syntax

C#
public void UpdateDataset(
	IDbCommand insertCommand,
	IDbCommand deleteCommand,
	IDbCommand updateCommand,
	DataSet dataSet,
	string tableName,
	AdoHelper<(Of <(<'TFactory>)>)>..::..RowUpdatingHandler rowUpdatingHandler,
	AdoHelper<(Of <(<'TFactory>)>)>..::..RowUpdatedHandler rowUpdatedHandler
)
Visual Basic
Public Sub UpdateDataset ( 
	insertCommand As IDbCommand,
	deleteCommand As IDbCommand,
	updateCommand As IDbCommand,
	dataSet As DataSet,
	tableName As String,
	rowUpdatingHandler As AdoHelper<(Of <(<'TFactory>)>)>..::..RowUpdatingHandler,
	rowUpdatedHandler As AdoHelper<(Of <(<'TFactory>)>)>..::..RowUpdatedHandler
)

Parameters

insertCommand
Type: System.Data..::..IDbCommand
A valid SQL statement or stored procedure to insert new records into the data source
deleteCommand
Type: System.Data..::..IDbCommand
A valid SQL statement or stored procedure to delete records from the data source
updateCommand
Type: System.Data..::..IDbCommand
A valid SQL statement or stored procedure used to update records in the data source
dataSet
Type: System.Data..::..DataSet
The DataSet used to update the data source
tableName
Type: System..::..String
The DataTable used to update the data source.
rowUpdatingHandler
Type: CodeSmith.Engine..::..AdoHelper<(Of <(<'TFactory>)>)>..::..RowUpdatingHandler
RowUpdatingEventHandler
rowUpdatedHandler
Type: CodeSmith.Engine..::..AdoHelper<(Of <(<'TFactory>)>)>..::..RowUpdatedHandler
RowUpdatedEventHandler

Examples

 Copy imageCopy
RowUpdatingEventHandler rowUpdatingHandler = new RowUpdatingEventHandler( OnRowUpdating ); 
RowUpdatedEventHandler rowUpdatedHandler = new RowUpdatedEventHandler( OnRowUpdated ); 
helper.UpdateDataSet(sqlInsertCommand, sqlDeleteCommand, sqlUpdateCommand, dataSet, "Order", rowUpdatingHandler, rowUpdatedHandler);

See Also