Create SqlDataadapter from Dataview

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
 
W

William \(Bill\) Vaughn

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.
__________________________________
 

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

Top