Results 1 to 3 of 3

Thread: DataSource Update

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    12

    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.

  2. #2
    Addicted Member CoMMiE's Avatar
    Join Date
    Jul 2000
    Location
    Malaysia, Kuala Lumpur
    Posts
    179
    Hi
    You should have use m_oDataAdapter to update to your database instead of Da since the commandbuilder object is refering to m_oDataAdapter

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    12
    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
  •  



Click Here to Expand Forum to Full Width