By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,988 Members | 1,360 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,988 IT Pros & Developers. It's quick & easy.

Bound Data Saving Problem in Access 2003

P: 59
Hi All,

I have an Access Db Table Called Employees. The columns are as follows:

  1. EmployeeId (Autonumber) PK
  2. EmployeeName (Text)
  3. EmployeeRole (Test)
  4. DateOfJoining (DateTime)

I am displaying the data in a simple DataGridView in a winform by using the following code:

Expand|Select|Wrap|Line Numbers
  1. da.Fill(ds,"Employee")
where da is the OledbDataAdapter and ds is the DataSet.

Next is the simple code of binding:

Expand|Select|Wrap|Line Numbers
  1. dgv.DataSource=ds.Tables["Employee"];
Here dgv is the dataGridView. I have used a command builder object to create the Insert/Update/Delete commands for the DataAdapter da.

However when I try to Update the Added record in the dataBase using:

Expand|Select|Wrap|Line Numbers
  1. da.Update(ds.Tables["Employee"]
it gives an error. I realise I need to define the insert command for the DataAdapter da, seperately. I tried searching in internet but could not locate something.
Can someone guide me to such page or suggest a solution for the problem?

Feb 27 '09 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.