command.ExecuteNonQuery();后面总是显示')' 附近有语法错误 请各位高手指点一下不剩感激 10
privatevoidtoolStripButton1_Click(objectsender,EventArgse){con.Open();//打开连接using(Sql...
private void toolStripButton1_Click(object sender, EventArgs e)
{
con.Open();//打开连接
using (SqlCommand command = new SqlCommand("insert into stdent" + "values(@s_no,@s_name)", con))
{
command.Parameters.Add("@s_no", SqlDbType.Char, 8, "s_no").Value = this.textBox1.Text;
command.Parameters.Add("@s_name", SqlDbType.Char, 8, "s_name").Value = this.textBox2.Text;
command.ExecuteNonQuery();
}
} 展开
{
con.Open();//打开连接
using (SqlCommand command = new SqlCommand("insert into stdent" + "values(@s_no,@s_name)", con))
{
command.Parameters.Add("@s_no", SqlDbType.Char, 8, "s_no").Value = this.textBox1.Text;
command.Parameters.Add("@s_name", SqlDbType.Char, 8, "s_name").Value = this.textBox2.Text;
command.ExecuteNonQuery();
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询