From Datagrid to Database

N

N! Xau

HI,

I've posted this question, that may be trivial, in other ng, but I
can't come to a result.

A form displays a datagrid, showing data from a table T. User can
modify data on the grid, then he has to click on a button on the same
form to save data in DB. I've troubles with this last thing, I don't
see how to use dataadapter.update().

Let's say T is:
fieldA | fieldB | fieldC
ABC | 111 | 222
DEF | 333 | 444

and user manually change 444 into 445. I would do:
dim myQuery as string = "..."
dim myCmd as new oraclecommand(myQuery,myConnection)
dim myAdapt as new oracledataadapter(myCmd)
myadapt.Update ' ???

Is that correct? And how about the query? Is that necessary or the
adapter spots the row that have change and issue the necessary updates?

Thanks for help,
I am really stuck into this
N! Xau
 
N

N! Xau

Ken:
You need to have an
update, insert, and delete commands for the dataadapter


You mean I have to write (or build) a query, pass it to the command,
and pass the command to the adapter?

Is this not the same thing we do every time we issue a query?

I read the msdn help, but I don't see how to map the fieldnames in db
to the fieldnames in the grid.

thanks
N! Xau
 
Top