首页上一页 1 下一页尾页 3 条记录 1/1页
c#开发实战17.4例子报错
发表在C#图书答疑
2015-02-10
是否精华
是
否
版块置顶:
是
否
string strSql = "select * from staff_dict ";
DataTable dtUpdate = new DataTable();
dtUpdate = this.dbconn(strSql);
dtUpdate.Rows.Clear();
DataTable dtShow = new DataTable();
try
{
dtShow =(DataTable)this. dataGridView1.DataSource ;
dtUpdate .ImportRow (dtShow.Rows [intindex ]);
OracleCommandBuilder CommandBuilder;
CommandBuilder = new OracleCommandBuilder(this.sda);
this.sda.Update(dtUpdate);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
return false;
}
dtUpdate.AcceptChanges();
return true;
}
中的 dtShow =(DataTable)this. dataGridView1.DataSource ;
无法将system.data.dataview转换为system.data.datatable
DataTable dtUpdate = new DataTable();
dtUpdate = this.dbconn(strSql);
dtUpdate.Rows.Clear();
DataTable dtShow = new DataTable();
try
{
dtShow =(DataTable)this. dataGridView1.DataSource ;
dtUpdate .ImportRow (dtShow.Rows [intindex ]);
OracleCommandBuilder CommandBuilder;
CommandBuilder = new OracleCommandBuilder(this.sda);
this.sda.Update(dtUpdate);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
return false;
}
dtUpdate.AcceptChanges();
return true;
}
中的 dtShow =(DataTable)this. dataGridView1.DataSource ;
无法将system.data.dataview转换为system.data.datatable