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.
 
Back
Top