Hi All,
I have an Access Db Table Called Employees. The columns are as follows:
I am displaying the data in a simple DataGridView in a winform by using the following code:
where da is the OledbDataAdapte r and ds is the DataSet.
Next is the simple code of binding:
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:
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?
Regards
I have an Access Db Table Called Employees. The columns are as follows:
- EmployeeId (Autonumber) PK
- EmployeeName (Text)
- EmployeeRole (Test)
- DateOfJoining (DateTime)
I am displaying the data in a simple DataGridView in a winform by using the following code:
Code:
da.Fill(ds,"Employee")
Next is the simple code of binding:
Code:
dgv.DataSource=ds.Tables["Employee"];
However when I try to Update the Added record in the dataBase using:
Code:
da.Update(ds.Tables["Employee"]
Can someone guide me to such page or suggest a solution for the problem?
Regards