Insert into Access DB Using DataSet

  • Thread starter Thread starter Sarathi
  • Start date Start date
S

Sarathi

Hi...
Here is my code and my problem is that it doesn't update DB.
Langauage Used : C#
OleDbAdapter customerDA= new OleDbAdapter("Select * from
Cusomers",connection);
DataSet customerDS = new DataSet();
customerDA.Fill(customerDS);

DataRow customerRow = customerDS.Tables[0].NewRow();
customerRow["Name"] = "Kris";
customerDS.Tables[0].Rows.Add(customerRow);
customerDA.Update(customerDS.Tables[0].Select(null,null,DataViewRoState.Adde
d);
connection.close();
 
Don't you need to set the dataadapters .InsertCommand?

greets
 

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