No matter how you approach the app-end of the code, SQL server will still
need to have a procedure with individual columns specified for
inserts/updating, etc.
MS offer the DAAB through their patterns & practices sub-site. The DAAB is
a library that provides some abstraction techniques for making your code
easier to read and faster to write.
One of these techniques is the UpdateDataset method, which allows you to
specify sprocs for Insert, Update, Delete (or only one of these), and pass a
dataset that these sprocs will operate against. I believe that this
approach also is smart enough to only update the records that actually have
changes, so if the current row hasn;t changed since being loaded from the
DB, it doesn;t get sent over the wire to the DB for updating.
You will still need to write your sproc in full and specify the parameters
for each sproc in your app code (no getting away from that yet!), e.g;
dbCmd = db.GetStoredProcCommand("usp_My_UPDATE_sproc_name")
db.AddInParameter(dbCmd, "RepID", DbType.Int32, "RepID",
DataRowVersion.Current)
db.AddInParameter(dbCmd, "ClientID", DbType.Int32, myClient.ClientID)
db.AddInParameter(dbCmd, "RptOrder", DbType.Int32, "RptOrder",
DataRowVersion.Current)
db.AddInParameter(dbCmd, "ForOHA", DbType.Boolean, "ForOHA",
DataRowVersion.Current)
db.AddInParameter(dbCmd, "KPIBoundary", DbType.Int32, "KPIBoundary",
DataRowVersion.Current)
Dim rowsAffected As Integer = db.UpdateDataSet(Me.dsCustomer, "Reports",
Nothing, dbCmd, Nothing, UpdateBehavior.Continue)
Alec