Public Shared Function proc(ByVal prcname As String, ByVal prcnames() As String, ByVal prcvalues() As String) As String
Dim id As String = ""
Dim cmd As New SqlCommand
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = prcname
Dim i As Integer = 0
For i = 0 To prcnames.Length - 1
cmd.Parameters.AddWithValue(prcnames(i).ToString(), prcvalues(i).ToString())
cmd.Parameters(prcnames(0)).Direction = ParameterDirection.InputOutput
Next
DataConnect.GetInstance.ExecuteNonQuery(cmd)
id = cmd.Parameters(prcnames(0)).Value
Return id
End Function
No comments:
Post a Comment