DataSet

F

Fabian

Hello everybody, I would like to know if someone can help me with a DataSet.
In my case the select command that fills the DataSet is a view (sql2000)
that contains 10 tables, I have defined the SQLDataAdapter as follows:
Dim SqlAdapter As New SqlDataAdapter("SELECT * FROM vw_DG_PERSONAS", SqlCon)


En evento Load del Frm tengo esto:
SqlCon.ConnectionString = "Server=" & Svr & _
";Database=dgcontrol;uid=" & Usr & ";pwd=" & Psw & ";"
SqlAdapter.Fill(DsPersonas, "vw_DG_PERSONAS")
SqlCon.Close()
DataGrid1.DataSource = DsPersonas
DataGrid1.DataMember = "tbl_per_personas"

My problem is that the window has a DataGrid that shows the view, and I
modify the data, then I want to save the changes to the SQL DB, so
I do the following:

SqlAdapter.Update(DsPersonas), and here this error occurs:
(Update can not find TableMApping('Table') o DataTable 'Table')

Please i someone can help me on working with DataSet, just tell me, Thanks.
 
S

SStory

Well, I think Adapters update tables and not dataset so maybe you would need
to specify the table in the database to update.
 
B

Brad Allison

Fabian,

SqlAdapter.Update(DsPersonas, "Table") -or-
SqlAdapter.Update(DsPersonas, <index of table>)

Hope this helps.

Brad
 

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