为了账号安全,请及时绑定邮箱和手机立即绑定

c#,'( ' 附近有语法错误.

c#,'( ' 附近有语法错误.

C#
温温酱 2018-11-27 01:00:27
private void button1_Click(object sender, EventArgs e){SqlConnection c = new SqlConnection(Properties .Settings .Default .mainConnectionString );c.Open();string s = "insert into menu(编号,名称,价目(元))values('"+textBox1 .Text .ToString ()+"'+'"+textBox2 .Text .ToString ()+"'+'"+textBox3 .Text .ToString ()+"')";SqlCommand cm = new SqlCommand(s,c);//cm.CommandText = s;//cm.Connection = c;int q= cm.ExecuteNonQuery();if (q == 1) { MessageBox.Show("添加成功"); }else { MessageBox.Show("添加失败"); }c.Close();}
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 565 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信