当前位置: 移动技术网 > IT编程>开发语言>.net > VB.NET调用MySQL存储过程并获得返回值的方法

VB.NET调用MySQL存储过程并获得返回值的方法

2017年12月12日  | 移动技术网IT编程  | 我要评论

饭局的诱惑 第一期,世界佳丽登长城,隋唐英雄传在线阅读

本文实例讲述了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程序设计有所帮助。

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网