“)”处有错???
String s = "server=.;database=SampleDb;integrated Security=true;";SqlConnection conn = new SqlConnection();
conn.ConnectionString = s;
SqlCommand com = new SqlCommand();
String sql = String.Format("delete from Lesson where Id='{0}' and Name='{1}')",textBox1.Text,textBox2.Text);
com.Connection = conn;
= sql;
conn.Open();
int n = com.ExecuteNonQuery();
conn.Close();
MessageBox.Show("删除成功");