Vb.net 如何使用存储过程将文本框和复选框中的数据插入SQL Server
这是我在vb.net中的代码,但当我运行此代码时,它没有响应Vb.net 如何使用存储过程将文本框和复选框中的数据插入SQL Server,vb.net,sql-server-2008,Vb.net,Sql Server 2008,这是我在vb.net中的代码,但当我运行此代码时,它没有响应 If CheckBox5.Checked = True Then TextBox30.Enabled = True .Parameters.Add("MOD3", SqlDbType.NVarChar, 20).Value = TextBox30.Text Else TextBox30.Enabled = False End If 对不起-什么?!?!?这似乎不是一个非常完整的代码列表。。。。请提供有关
If CheckBox5.Checked = True Then
TextBox30.Enabled = True
.Parameters.Add("MOD3", SqlDbType.NVarChar, 20).Value = TextBox30.Text
Else
TextBox30.Enabled = False
End If
对不起-什么?!?!?这似乎不是一个非常完整的代码列表。。。。请提供有关您的问题的更多有意义的信息!另外,请说明您的代码出了什么问题
If CheckBox5.Checked = True Then
TextBox30.Enabled = True
Dim cmd as new SqlCommand
cmd.CommandText = "your store procedure name here.."
cmd.CommandType = CommandType.StoreProcedure
cmd.Connection = con //your connection string object
cmd.Parameters.Add("MOD3", SqlDbType.NVarChar, 20).Value = TextBox30.Text
con.Open()
cmd.ExecuteNonQuery()
con.Close()
Else
TextBox30.Enabled = False
End If