Page 1 of 1

MySqlCommandBuilder does not work

Posted: Wed 25 Mar 2009 19:03
by bigpoint
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?

Posted: Thu 26 Mar 2009 15:13
by Shalex
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/ .