-
DataSource Update
I have a datagrid and wish to update the datasource for that grid (sql server 2000) using something like :
public sub updatedatasource(ByVal objDataset as DataSet)
Dim custCB As New SqlCommandBuilder(m_oDataAdapter)
da.Update(objDataset, "table")
end sub
(da is declared and initialized earlier)
This does not work. Gives me an error message 'Dataadapter.Selectcommand needs to be initialized'.
I fill it in a separate function, let the user edit it and then update it through a separate function as shown above.
Could someone please help me with this.
-
Hi
You should have use m_oDataAdapter to update to your database instead of Da since the commandbuilder object is refering to m_oDataAdapter
-
Thank you for your reply. I did use the adapter. But i still had to run the same query as i ran during Fill and then run the update.