Пример #1
0
 public void clear()
 {
     Sno.ItemsSource   = null;
     Cname.ItemsSource = null;
     Ssredit.Clear();
     Rmark.Text = null;
 }
Пример #2
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            string sql = "update ranah_Result"
                         + " set rah_Rmark=" + Rmark.Text
                         + " where rah_Sno='" + Sno.Text + "'"
                         + " and rah_Couno='" + Couno_text() + "'";
            SqlCommand cmd = new SqlCommand(sql, Window1.conn);

            try
            {
                cmd.ExecuteNonQuery();
                MessageBoxResult res = MessageBox.Show("修改成功");
            }
            catch (Exception ee)
            {
                MessageBoxResult res = MessageBox.Show("修改失败" + ee.Message);
            }
            Ssredit.Clear();
        }