P
Percy NG
Hi,
I used OleDb.OleDbDataAdapter to retrive and modify the access
i used merge function to combin another dataset, then update Access DB
but i can't update the database by using pDataAdapter.Update(ds_data)
the result is always 0
Here is my code
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''
pDataAdapter.SelectCommand = New OleDb.OleDbCommand(Sql, mConn)
pDataAdapter.Fill(ds_data)
Dim Key1() As DataColumn = {ds_data.Tables(0).Columns("item"),
ds_data.Tables(0).Columns("desc")}
ds_data.Tables(0).PrimaryKey = Key1
ds_data.AcceptChanges()
ds_data.Merge(datainfo, True, MissingSchemaAction.AddWithKey)
pDataAdapter.Update(ds_data)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''
I am not sure what is problem, any suusgestion for updating Access with
dataset ???
Thanks
Percy
I used OleDb.OleDbDataAdapter to retrive and modify the access
i used merge function to combin another dataset, then update Access DB
but i can't update the database by using pDataAdapter.Update(ds_data)
the result is always 0
Here is my code
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''
pDataAdapter.SelectCommand = New OleDb.OleDbCommand(Sql, mConn)
pDataAdapter.Fill(ds_data)
Dim Key1() As DataColumn = {ds_data.Tables(0).Columns("item"),
ds_data.Tables(0).Columns("desc")}
ds_data.Tables(0).PrimaryKey = Key1
ds_data.AcceptChanges()
ds_data.Merge(datainfo, True, MissingSchemaAction.AddWithKey)
pDataAdapter.Update(ds_data)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''
I am not sure what is problem, any suusgestion for updating Access with
dataset ???
Thanks
Percy