DataBase update with Dataset

  • Thread starter Thread starter cvncpu
  • Start date Start date
C

cvncpu

I have this function:

[WebMethod]
public string SetUserInfo(string AuthID, DataSet dg2)
{
if (AuthID=="********")
{
Oconn.Open();
da.Update(dg2);
Oconn.Close();
return "it seems to have worked.";
}
else
{
return "Your Authentication Failed";
}
}

and this is my da var: public SqlDataAdapter da = new
SqlDataAdapter();

but it keeps coming back with an error: "Update unable to find
TableMapping['Table'] or DataTable 'Table'
 
Hi,

You must configure the data adapter with table and column mappings for each
data table the "dg2" data set contains.
Please refer to the DataAdapter.TableMappings property documentation in
MSDN.
 

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

Back
Top