string connectionString = "Data Source=aspnet;User ID=aspnet;Password=aspnet;";
OracleConnection dbConnection = new OracleConnection(connectionString);
string selectString = "select * from Customers";
OracleDataAdapter dataAdapter = new OracleDataAdapter(selectString,dbConnection);
DataSet ds = new DataSet();
dbConnection.Open();
dataAdapter.Fill(ds,"Customers");
DataGrid1.DataSource = ds;
DataGrid1.DataBind();
OracleCommandBuilder cmdBuilder = new OracleCommandBuilder(dataAdapter);
ds.Tables["Customers"].Rows[0].Delete();
dataAdapter.Update(ds,"Customers");
DataGrid2.DataSource = ds;
DataGrid2.DataBind();
dbConnection.Close();
Error: Dynamic SQL generation for the DeleteCommand is not supported against a SelectCommand that does not return any key column information
我想有可能是.net的问题,因为我把原代码发到朋友的机子上运行都江没有问题,请高手指点。我用的是Microsoft Visual Studio .NET 2003,C#,.NET framework 1.1,而且我自己重新安装过.NET framework 和 IIS。