标题:[求助]DELETE
取消只看楼主
lujinhui66
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2006-5-22
 问题点数:0 回复次数:0 
[求助]DELETE

string StrSQL="DELETE FROM gqsz WHERE xh='"+this.listView1.SelectedItems [0].Text.Trim()+"'";
this.sqlCommand1.CommandText=StrSQL;
this.sqlCommand1.Connection=this.con;
//打开数据库连接
this.con.Open();
//执行SQL命令
this.sqlCommand1.ExecuteNonQuery();
//关闭连接
this.con.Close();
//更新数据集
this.dataSet1.Tables["gqsz"].Rows[this.MyBind.Position].BeginEdit();
this.dataSet1.Tables["gqsz"].Rows[this.MyBind.Position].EndEdit();
this.dataSet1.AcceptChanges();
this.SqlDataAdapter1.Fill(this.dataSet1,"gqsz");
this.MyBind.Position=this.MyBind.Count;

MessageBox.Show("此操作将会删除选定的歌曲","信息提 示",MessageBoxButtons.YesNo,MessageBoxIcon.Question,MessageBoxDefaultButton.Button1);

错误显示:未将对象引用设置到对象实例。

小弟刚学,很菜
是哪里应该怎么写!!!!万分感谢!!!!!

搜索更多相关主题的帖子: DELETE 
2006-05-24 22:15



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




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

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