从网上搜说是sql语句有错误,但是感觉应该没有错误
代码如下
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection cn = new SqlConnection();
cn.ConnectionString = ConfigurationManager.ConnectionStrings["connectname"].ConnectionString;
cn.Open();
SqlCommand cm = new SqlCommand("insert into student(id,name,num,time,ctime) values('" + this.TextBox1.Text+ "', '" + this.TextBox2.Text + "', '" + this.TextBox3.Text + "', '" + this.TextBox4.Text + "', '" + this.TextBox5.Text+"'",cn);
cm.ExecuteNonQuery();//这个地方报错
cn.Close();
求大神解救!!!!