我在 SQL Server 中有一个存储过程用于生成事务号。
任何人都可以帮助我如何从 VB.NET 调用存储过程以及如何获取从过程返回到前端的值。
问候,
乔治
我想你想要这样的东西:
Public Sub Foo()
Using sql As New SqlClient.SqlConnection("YourConnection")
sql.Open()
Using cmd As New SqlClient.SqlCommand("YourSPName", sql)
cmd.CommandType = CommandType.StoredProcedure
Dim myReturnValue As String = cmd.ExecuteScalar
End Using
End Using
End Sub
其中返回值将是 SQL 中的输出参数。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)