Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 如何使用存储过程将文本框和复选框中的数据插入SQL Server_Vb.net_Sql Server 2008 - Fatal编程技术网

Vb.net 如何使用存储过程将文本框和复选框中的数据插入SQL Server

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 对不起-什么?!?!?这似乎不是一个非常完整的代码列表。。。。请提供有关

这是我在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
         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