|
-
Oct 2nd, 2002, 12:12 PM
#1
Thread Starter
New Member
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.
Last edited by NickPra; Oct 2nd, 2002 at 12:49 PM.
-
Oct 6th, 2002, 11:37 PM
#2
Addicted Member
Hi
You should have use m_oDataAdapter to update to your database instead of Da since the commandbuilder object is refering to m_oDataAdapter
-
Oct 7th, 2002, 07:47 AM
#3
Thread Starter
New Member
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.
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
|