public static IDbCommand BuildStoredProcedureUpdateCommand( DataRow changedRow, KeyType primaryKeyType, string primaryKeyField, IDataService dataService, DataRowUpdateMode updateMode, string storedProcedurePrefix );
primaryKeyType
Primary key type (guid, integer,...)
primaryKeyField
Name of the primary key field
dataService
Instance of a concrete data service
updateMode
Should all fields be sent to the server, or only the changed ones?
storedProcedurePrefix
Prefix used for the stored procedure
[Prefix]upd[TableName]
in a scenario where the default prefix is used, and the table name is Customer, the following Stored Procedure would be required:
milos_updCustomer
e SP needs to accept one parameter for each field (named the same as the fields - the cName field requires a corresponding @cName parameter) as well as an additional
rameter called @__cChangedFields, which contains a comma-separated list of all changed fields (with a trailing comma, and no spaces).
e Stored Procedure also needs to know (without any outside parameters) what the name of the primary key field is that is used to identify the updated row. This value is simply passed to this SP as one of the parameters.