How does update work

P

PhilM

I bind a Datagrid to a recordset obtained from a stored proc in SQL server.
DataGrid displays the recordset.
User updates some data on the grip, pushes update button.
Event code calls Datagrid1.Update ... but what should that do? I suppose it
executes the code stored in the Update command of the Dataset it is bound
to, but should I write a stored proc to update the database, and if I do how
does the data get to the stored proc?
 
B

Brock Allen

You need to fetch the row in the datagrid, find every cell, dig into the
cell, find the server control and fetch the value. Once you have all of the
values for all if your columns, then you use that data to do your update
in the DB. It's a PITA. As an aside, 2.0 makes thie much easier with 2-way
databinding.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top