Create Stored Procedure with vb.net
I try to create a stored procedure with vb.net and MySqlConnector. When running the script in Mariadb it runs well.
DELIMITER CREATE DEFINER=`root`@`localhost` PROCEDURE IF NOT EXISTS
Coding
END //
When I run it in vb.net, I get the following error.
MySqlConnector.MySqlException: ''DELIMITER' should not be used with MySqlConnector. See https://fl.vu/mysql-delimiter' Inner exeption MySqlException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DELIMITER CREATE DEFINER=`root`@`localhos...' at line 1
I Tried also with DILIMITER $$ and without DILIMITER, but that is not exepted by Mariadb. How can I solve my error.
Answer
To solve this problem the type of the CMD can be put as text. So Delimiter is not needed.
Dim cmd As New MySqlCommand() cmd.connection = MysqlConn cmd.commandtype = CommandType.Text cmd.CommandText = Query cmd.ExecuteNonQuery()
Thx for the fast and very good explanation of mr. T.B. of Mariadb