Saving data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a datagrid linked to a SQL Stored Procedure, the data is extracted
from 4 tables. Data is only updated not inserted and the update is to only 1
of the tables, the other three tables are information only. Can anybody help
with a save routine.
 
You need a good book on ADO.NET to fish your way out of the relevant saving
routines. I've explained this fairly well in my book, but here is an
overview.

I assume the datagrid is bound to a dataset? You need SqlDataAdapter.Update
to persist the changes back to the d/b. You will have to worry about
a) Performance
b) Concurrency.
c) Ease of code.

Based on the above two, you could decide on using between a CommandBuilder
object/Automatic Update back to db, or Specify an UpdateCommand on the data
adapter object.

Beyond that it's all about calling a simple stored proc .. thats it :)

Also, there are many ways to skin this cat other than the above.

- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik
 
Create a stored procedure that updates the data, using a data adapter
and its corresponding update command property to save the changed
values in the dataset.

Catch you later,

Boyd
 
Back
Top