Skip to content

Vb.net to Mysql

ramesh babu

Asked Aug 19, 2009, 3:00 AM EDT1 answer
Share
LinkedInX
I written coding below it display error
"Fatal error encountered during command execution."
How can i rectify

Coding is....
MyTrans = Myconn.BeginTransaction()
Mycmd = New MySqlCommand()
Mycmd.Connection = Myconn
Mycmd.CommandText = "DELIMITER $$ " & _
" CREATE PROCEDURE `Sp_example`(in Name varchar(45)) BEGIN " & _
" declare _output int; " & _
" select count(id) from name " &_
" where createdby=_Userid " &_
" into _output; " &_
" select _output; " _
" END $$ " & _
" DELIMITER ; "
Mycmd.CommandType = CommandType.Text
If Myconn.State <> ConnectionState.Open Then Myconn.Open()
Mycmd.ExecuteNonQuery()
MyTrans.Commit()

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Mahesh Chand
    0
    May be your SQL query is incorrect.

    One way to figure this out is copy your SQL command text in Debug mode and copy same SQL string and run on the database and see if SQL query executes.
    0