[求助问题出在哪里〉???
修改数据库的sql语句 private void Button1_Click(object sender,EventArgs e) { string strConn="server=Localhost;uid=sa;pwd=137;database=qxdata"; string strCmd="update ldjh set title='"+TextBox1.Text+"' content='"+TextBox2.Text+"' name='"+TextBox3.Text+"' department='"+TextBox4.Text+"' where ID = '"+Label1.Text+"'"; SqlConnection myConnection = new SqlConnection(); myConnection.ConnectionString=strConn; myConnection.Open(); SqlCommand myCommand=new SqlCommand(strCmd,myConnection); myCommand.ExecuteNonQuery(); myCommand.Connection.Close(); myConnection.Close();
}