注:表 student 各属性都是char类型  这是保存按钮的事件            try
            {
                DataRow dr = ds.Tables["student"].NewRow();
                dr["sno"] = Int32.Parse(textBox1.Text);
                dr["sname"] = Int32.Parse(textBox2.Text);
                dr["ssex"] = Int32.Parse (textBox3.Text);
                dr["sdept"] = Int32.Parse (textBox4.Text);
                dr["dno"] = Int32.Parse (textBox5.Text);
                dr["stime"] = Int32.Parse (textBox6.Text); 
                ds.Tables["student"].Rows.Add(dr);
                da.Update(ds,"student");
                this.BindingContext[ds, "student"].Position = this.BindingContext[ds, "student"].Count-1;            }
            catch (Exception  ee) { MessageBox.Show("保存数据失败"+ee.Message ); }
         }