VB.NET调用MySQL存储过程并获得返回值的方法
本文实例讲述了VB.NET调用MySQL存储过程并获得返回值的方法。分享给大家供大家参考。具体实现方法如下:
DimmyConnectionStringAsString="Database="&myDatabase&_ ";DataSource="&myHost&_ ";UserId="&myUserId&";Password="&myPassword DimmyConnectionAsNewMySqlConnection(myConnectionString) Try myConnection.Open() CatchMyExceptionAsMySqlException Console.WriteLine("Connectionerror:MySQLcode:"&MyException.Number&_ ""+MyException.Message) EndTry Try DimmyCommandAsNewMySqlCommand("callerror_test_proc(1)") myCommand.Connection=myConnection myCommand.ExecuteNonQuery() CatchMyExceptionAsMySqlException Console.WriteLine("Storedprocedureerror:MySQLcode:"&_ MyException.Number&""&_ MyException.Message) EndTry
希望本文所述对大家的VB.NET程序设计有所帮助。