标题:[求助]关于数据库操作的问题
取消只看楼主
scwfeng
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-9-4
 问题点数:0 回复次数:0 
[求助]关于数据库操作的问题

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();650)this.style.width=650;" alt="Stick out tongue" src="/emoticons/emotion-4.gif">650)this.style.width=650;" alt="Stick out tongue" src="/emoticons/emotion-4.gif">

650)this.style.width=650;" alt="Stick out tongue" src="/emoticons/emotion-4.gif">

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。650)this.style.width=650;" alt="Stick out tongue" src="/emoticons/emotion-4.gif">650)this.style.width=650;" alt="Stick out tongue" src="/emoticons/emotion-4.gif">

搜索更多相关主题的帖子: 数据库 
2006-09-04 13:04



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-87912-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.295733 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved