OleDbDataAdapter.FILL()重载出错
private void DgDataBind()
{
string DataPath = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=f:\\data\\db1.mdb";
OleDbConnection conn = new OleDbConnection(DataPath);
string strCmd = "Select * From Dv_User";
DataSet DataSet1 = new DataSet();
OleDbDataAdapter DataAdapter1 = new OleDbDataAdapter(strCmd,conn);
DataAdapter1.Fill( DataSet1 ,"Table1");
DataGrid1.DataSource = DataSet1;
DataGrid1.DataBind();
}
{
string DataPath = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=f:\\data\\db1.mdb";
OleDbConnection conn = new OleDbConnection(DataPath);
string strCmd = "Select * From Dv_User";
DataSet DataSet1 = new DataSet();
OleDbDataAdapter DataAdapter1 = new OleDbDataAdapter(strCmd,conn);
DataAdapter1.Fill( DataSet1 ,"Table1");
DataGrid1.DataSource = DataSet1;
DataGrid1.DataBind();
}
结果提示:
|
编译器错误信息: CS1502: 与“System.Data.OleDb.OleDbDataAdapter.Fill(System.Data.DataTable, object)”最匹配的重载方法具有一些无效参数
就是这里不明白,书上的重载方法是这样,MSDN里面也有这个重载方法,不知道为什么不行
源文件在这里,共3个文件(DataSet.aspx、DataSet.aspx.cs、db1.mdb)
[此贴子已经被作者于2007-7-28 16:26:31编辑过]