|
-
Feb 3rd, 2002, 04:16 PM
#1
Dataset update issue
Hi All,
Need help. Have been going through MSDN and trying to get the dataset Update working.
I have created the dataset through the oledbdataadapter. Set the datasource of the datagrid to dataset.theTable.
It works fine and displays data in the grid. I change the data in the grid and try to update. I don't get any error. But it just doesnt update my databse. When I call the Fill method to refresh the grid , it shows the original data and not the updated ones.
Here is the code I have been trying .If you can find out what went wrong please let me know.
My first try after changing the data in the grid
OleDbConnection1.Open()
DataSet11.AcceptChanges()
OleDbDataAdapter1.Update(DataSet11, "JOBLOAD")
OleDbConnection1.Close()
OleDbDataAdapter1.Fill(DataSet11)
My second try changing data through the code
OleDbConnection1.Open()
Dim aRow As DataRow = DataSet11.Tables("JOBLOAD").Rows(1)
arow("JOBNUMBER") = 1111
DataSet11.AcceptChanges()
Dim changedRows As DataRow() = DataSet11.Tables("jobload").Select(Nothing, Nothing, DataViewRowState.ModifiedCurrent)
OleDbDataAdapter1.Update(changedRows)
OleDbConnection1.Close()
My third try was through using the Command 's Executenonquery() method which worked fine.
Any help appreciated.
thx
Sree
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|