Dim cnn As SqlConnection = New SqlConnection("server=PC-201504020821;database=SHOYO;uid=sa;pwd=1234;")
cnn.Open()
Dim cm As New SqlDataAdapter()
cm.SelectCommand = New SqlCommand()
cm.SelectCommand.Connection = cnn
cm.SelectCommand.CommandText = "Add_dingdan" ‘’存盤程序為:"Add_dingdan"
cm.SelectCommand.CommandType = CommandType.StoredProcedure
cm.SelectCommand.Parameters.AddWithValue("@name1", TextBox1.Text) ''添加輸入引數
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''以下3行是什么意思''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim parOutput '型別是什么
parOutput = cm.SelectCommand.Parameters.AddWithValue("@result1", SqlDbType.Int)
parOutput.Direction = ParameterDirection.Output '引數型別為Output
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
cm.SelectCommand.ExecuteNonQuery() ''
MsgBox(cm.SelectCommand.Parameters("@result1").Value) ‘’顯示回傳值
問題:請決議一下上面3行代碼的意思,有沒有更簡單的其他方法!
uj5u.com熱心網友回復:
建議先學習帶輸出引數的存盤程序怎么寫和怎么在查詢分析器中呼叫看輸出引數的回傳值。轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/54339.html
