//数据库数据更新、添加(传DataSet和DataTable的对象)
public DataSet UpdateDataBase(DataSet changedDataSet,string tableName)
{
this.myConnection = new OleDbConnection(connectionString);
this.da = new OleDbDataAdapter(this.strSQL,this.myConnection);
this.sqlCmdBld = new OleDbCommandBuilder(da);
this.da.Update(changedDataSet,tableName);
return changedDataSet;//返回更新了的数据库表
}
//调用如下:
if (e.Button.ToolTipText == "保存")
{
 try
 {
          int row = this.dataGrid1.CurrentCell.RowNumber;
 //将当前所在行往下移动一行,为便于实现同步保存
 //(否则会出现修改的最后一行无法保存,因为它还处于编辑状态)
                           this.dataGrid1.CurrentCell = new DataGridCell(row+1,0); 
 if (this.ds.HasChanges())
 {
this.link.UpdateDataBase(this.ds.GetChanges(),"test");
 da.Update(ds,"test");
 MessageBox.Show("数据修改成功!","信息");
}
else
{
 MessageBox.Show("没有修改的数据!");
return;
}
}
catch(Exception err)
{
         MessageBox.Show(err.Message);
    return;
}
}
报错如下:不返回任何基表信息不支持selectcommand,主键我建了有,为什么会出现这种问题!