VB.NET调用MySQL存储过程并获得返回值的方法
程序员文章站
2024-02-20 08:23:22
本文实例讲述了vb.net调用mysql存储过程并获得返回值的方法。分享给大家供大家参考。具体实现方法如下:
dim myconnectionstring as...
本文实例讲述了vb.net调用mysql存储过程并获得返回值的方法。分享给大家供大家参考。具体实现方法如下:
dim myconnectionstring as string = "database=" & mydatabase & _ " ;data source=" & myhost & _ ";user id=" & myuserid & ";password=" & mypassword dim myconnection as new mysqlconnection(myconnectionstring) try myconnection.open() catch myexception as mysqlexception console.writeline("connection error: mysql code: " & myexception.number & _ " " + myexception.message) end try try dim mycommand as new mysqlcommand("call error_test_proc(1)") mycommand.connection = myconnection mycommand.executenonquery() catch myexception as mysqlexception console.writeline("stored procedure error: mysql code: " & _ myexception.number & " " & _ myexception.message) end try
希望本文所述对大家的vb.net程序设计有所帮助。