更新时间:2023-02-11 21:40:42
我想你想要这样的:
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
其中 myReturnValue 将是您在 SQL 中的输出参数.
Where myReturnValue will be what ever your output param in SQL is.