我是一个编程初学者,有很多不懂的地方,希望大家多多指教!
Dim cmd As SqlCommand = New SqlCommand("dbo.pUptStudent ", myconn) cmd.CommandType = CommandType.StoredProcedure Dim para_studentID As SqlParameter = New SqlParameter("@StudentID", SqlDbType.NVarChar) para_studentID.Direction = ParameterDirection.Input para_studentID.Value = TxtstudentID.Text Dim para_studentname As SqlParameter = New SqlParameter("@Studentname", SqlDbType.NVarChar) para_studentname.Direction = ParameterDirection.Input para_studentname.Value = Txtstudentname.Text Dim para_classID As SqlParameter = New SqlParameter("@classid", SqlDbType.Int) para_classID.Direction = ParameterDirection.Input If txtclassID.Text = "" Then para_classID.Value = DBNull.Value Else para_classID.Value = txtclassID.Text End If Dim para_error As SqlParameter = New SqlParameter("@errstr", SqlDbType.NVarChar, 30) para_error.Direction = ParameterDirection.Output Dim para_return As SqlParameter = New SqlParameter("@RETURN_VALUE", SqlDbType.Int) para_return.Direction = ParameterDirection.ReturnValue cmd.Parameters.Add(para_studentID) cmd.Parameters.Add(para_studentname) cmd.Parameters.Add(para_classID) cmd.Parameters.Add(para_error) cmd.Parameters.Add(para_return) Try cmd.ExecuteNonQuery() If para_return.Value = 0 Then StatusBar1.Panels(0).Text = "修改成功!!" Else StatusBar1.Panels(0).Text = para_error.Value End If Catch ex As Exception StatusBar1.Panels(0).Text = ex.Message End Try 这个是要实现修改信息的一个VB.NET程序,我有些地方不怎么理解,知道的给我讲解一下吧!
谢谢了!!