0514-86177077
9:00-17:00(工作日)
本文实例讲述了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程序设计有所帮助。
标签:平凉 崇左 洛阳 青海 衢州 赣州 南宁 汕尾
上一篇:ASP.NET中将声音文件添加到资源中并进行播放的方法
下一篇:ASP.NET Web API如何将注释自动生成帮助文档