MySqlCommandBuilder does not work

MySqlCommandBuilder does not work

Postby bigpoint » Wed 25 Mar 2009 19:03

I am using Devart.Data.MySql V 5.0.22.0 and have a problem with the MySqlCommandBuilder:

Me.Da = New MySqlDataAdapter()
Me.Da.SelectCommand = "SELECT id,name FROM table;"

Dim ObjCb As New Devart.Data.MySql.MySqlCommandBuilder()
ObjCb.Quoted = True
ObjCb = New Devart.Data.MySql.MySqlCommandBuilder(Me.Da)


The commandBuilder does not produce any Commands. Can you help?
bigpoint
 
Posts: 2
Joined: Fri 02 Jun 2006 17:23

Postby Shalex » Thu 26 Mar 2009 15:13

To obtain the update commands use the code like this:
Code: Select all
Using conn As New MySqlConnection("host=db;uid=root;pwd=root;port=3306;database=test")
    Dim da As New MySqlDataAdapter()
    da.SelectCommand = New MySqlCommand("Select deptno,dname from dept", conn)
    Dim commBuilder As New MySqlCommandBuilder(da)
    da.InsertCommand = commBuilder.GetInsertCommand
    da.UpdateCommand = commBuilder.GetUpdateCommand
    da.DeleteCommand = commBuilder.GetDeleteCommand
End Using

For more information about the MySqlCommandBuilder class, please refer to our online documentation: http://www.devart.com/dotconnect/mysql/docs/ .
Shalex
Devart Team
 
Posts: 7774
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for MySQL