when I try to to write the example...
Dim adapter as MySqlDataAdapter
Dim cmd as MySqlCommand
Dim dataSet as DataSet
cmd.CommandText = "insert into animals (id, name) values (:id, :name); select id, name from animals where id = last_insert_id()"
...
adapter.Update(dataSet)
I get "MySqlDataAdapter/MySqlCommand is not defined" errors.
I do have the MySql toolbox and it's working alright.
What am I doing wrong...?
thanks in advance...
a problem with writing code (vb.net)
The right code is
Code: Select all
Dim adapter As MySqlDataAdapter = New MySqlDataAdapter
Dim connection As MySqlConnection = New MySqlConnection("host=server;user=root;password=root;database=test;")
Dim commandBuilder As MySqlCommandBuilder = New MySqlCommandBuilder
Dim command As MySqlCommand = New MySqlCommand("select * from dept", connection)
adapter.SelectCommand = command REM set SelectCommand Property here
commandBuilder.DataAdapter = adapter REM use command builder to generate insert, update, delete commands
Dim ds As DataSet = New DataSet
connection.Open()
Try
adapter.Fill(ds)
...
adapter.Update(ds)
Finally
connection.Close()
End Try
Thanks so much for the answer, however, the problem remains, somehow the .net still doest recognize mysqlnet elements, it's like these things are not defined or something is not included. The error shows before I even debug the project because somehow I can't get it to work with mysqlnet types.
Can it be because I've got only the standard edition?
Can it be because I've got only the standard edition?