How do I Update a Disconnected DataSet?

  • Thread starter Thread starter Bill Szerdy
  • Start date Start date
B

Bill Szerdy

Here is the code I have and it does not work. Any
Suggestions?

public bool saveRackTypes(DataSet saveSet)
{
SqlDataAdapter myDataAdapter = new SqlDataAdapter();
try
{
myDataAdapter.SelectCommand = new SqlCommand
("SELECT * FROM RackType", _myConnection);
myDataAdapter.Update(saveSet, "RackType");
return true;
}
catch(Exception e)
{
// write to log
return false;
}
finally
{
myDataAdapter = null;
saveSet = null;
}
}

Thanks
 
Hi Bill,

You are missing just a slight piece: insert, update and delete command that
is :)
You might read

Updating the Database with a DataAdapter and the DataSet
..net help topic.
 
Back
Top