用文本框的change事件就行了呗
把修改的数据放倒数据库

解决方案 »

  1.   

    tianjue0921(天珏):
    问题是怎么放?
      

  2.   

    我在textBox1_TextChanged()中加了这样一条指令:
    oleDbDataAdapter1.Update(dsAuthors1);
    修改文本框以后,DATAGRID也修改了,但是出现一个提示框:
    说“DataBinding无能在适合所有绑定的列表中找到行,要更正该值吗?
    答是或否都出错
      

  3.   

    你必须现在找到textBox1原由值所对应的行,然后通过该行,更新该行的textBox1所在列的
    字段
      

  4.   

    this.BindingContext[ds.Tables[0]].EndCurrentEdit();//结束编辑
    DataSet ds1 = ds.GetChanges();//ds为全局变量,ds1为改变的DataSet
    string customerID;
    foreach(DataRow row in ds1.Tables[0].Rows)
    {
    switch(row.RowState)
    {
    case DataRowState.Added:
    customerID=Convert.ToString(row["customerID"]);
                               //写inert into....插入记录
    break;
    case DataRowState.Modified:
    customerID=Convert.ToString(row["customerID"]);
                               //update了,自己写
    break;
    case DataRowState.Deleted:
    customerID = Convert.ToString(row["customerID",System.Data.DataRowVersion.Original]);
                               //delete sql,自己写
    break;
            }
    }
    ds.AcceptChanges();//保存完记的加这么一句
      

  5.   

    CurrencyManager cm = (CurrencyManager)this.BindingContext[dsAuthors1.Tables[0], ""];
    cm.EndCurrentEdit();
    oleDbDataAdapter1.Update(dsAuthors1);
    csAuthors1.AcceptChanges();
      

  6.   

    运行到oleDbDataAdapter1.Update(dsAuthors1);就出异常!!!