我用datatable保存了修改后的表信息,怎么才能让他保存到数据库,用devexpress控件gridview做的

解决方案 »

  1.   

    逐条将个geadview数据源保存到数据库中啊
    用DataAdapter实现
      

  2.   

     public int Updata(DataSet MyDS, DbTransaction mytran)
            {
                int rowAction = 0;
                this.dbAdapter.SelectCommand = this.CommandforCommandBiuder;
                this.dbAdapter.SelectCommand.Transaction = mytran;
                this.dbAdapter.UpdateCommand = CommandBiuder.GetUpdateCommand();
                this.dbAdapter.InsertCommand = CommandBiuder.GetInsertCommand();
                this.dbAdapter.DeleteCommand = CommandBiuder.GetDeleteCommand();
                this.dbAdapter.UpdateCommand.Transaction = mytran;
                this.dbAdapter.InsertCommand.Transaction = mytran;
                this.dbAdapter.DeleteCommand.Transaction = mytran;
                rowAction = this.dbAdapter.Update(MyDS, this.TableName);
                return rowAction;
            }
    整个表甚至整个DataSet更新