Hi,
I have following code.
Dim myData1 As MySqlDataReader
Dim sqlquary1 = "INSERT INTO table1 (text1) Values (Value1); INSERT INTO table2 (text2) Values (Value2); INSERT INTO table3 (text3) Values (Value3)"
Dim command1 As New MySqlCommand
command1.Connection = mySqlConnection
command1.CommandText = sqlquary1
myData1 = command1.ExecuteReader
mySqlConnection.Close()
I need to send few request to the mysql in the same time but I need to manage errors as well. I was using ; to seperate queries like:
"INSERT INTO table1 (text1) Values (Value1); INSERT INTO table2 (text2) Values (Value2); INSERT INTO table3 (text3) Values (Value3)"
but when error apear in first "INSERT" then db returned error and other INSERS are skipped.
Is there a easy way to open connection and then send the all INSERTS and close connection?