Create SqlDataadapter from Dataview

  • Thread starter Thread starter Robert Scheer
  • Start date Start date
R

Robert Scheer

Hi.

My code generates a datatable using data from a sqlserver database. I
generate a Dataview from this Datatable and bind it to a Datagrid.
From the Dataview I can see if my user changed records in the grid,
but how can I update the underlying database table? Is it possible to
generate a dataadapter from a dataview to update the database?

Thanks,

Robert Scheer
 
All you need to do is "just" create a set of SQL commands to change the
data. These go in the DataAdapter UpdateCommand, InsertCommand and Delete
command. OR you can create a SelectCommand (associated with the DataAdapter)
and use the CommandBuilder if you don't care about performance. Once all of
that's in place use the Update method.

hth

--
____________________________________
Bill Vaughn
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Back
Top