| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1146 人关注过本帖
标题:[求助]按Button删除DataGrid里的一行
只看楼主 加入收藏
yushengou
Rank: 1
等 级:新手上路
帖 子:401
专家分:0
注 册:2005-3-30
收藏
 问题点数:0 回复次数:7 
[求助]按Button删除DataGrid里的一行
按Button删除DataGrid里的一行。表是用SQL Server建的。
代码有人知道吗。
我想了好久想不出来。帮帮忙啊

[此贴子已经被作者于2005-4-22 16:45:15编辑过]


搜索更多相关主题的帖子: Button DataGrid SQL 删除 
2005-04-22 16:23
littleh
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2005-4-16
收藏
得分:0 
实例化一个DataTable,把删除row的处理放到DataTable里

2005-04-22 20:08
live41
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:67
帖 子:12442
专家分:0
注 册:2004-7-22
收藏
得分:0 
if(dataGrid1.CurrentCell.RowNumber>=0)
{
    dataSet1.Tables["Book"].Rows[dataGrid1.CurrentCell.RowNumber].Delete();
}
2005-04-22 23:39
yushengou
Rank: 1
等 级:新手上路
帖 子:401
专家分:0
注 册:2005-3-30
收藏
得分:0 
谢谢

我是初学者,希望大家能多多帮助我 /bbs/showimg.asp?BoardID=34&filename=2005-4/200542294030151.gif" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://bbs./bbs/showimg.asp?BoardID=34&filename=2005-4/200542294030151.gif');}" onmousewheel="return imgzoom(this);" alt="" />
2005-04-23 09:03
yushengou
Rank: 1
等 级:新手上路
帖 子:401
专家分:0
注 册:2005-3-30
收藏
得分:0 
以下是引用littleh在2005-4-22 20:08:28的发言: 实例化一个DataTable,把删除row的处理放到DataTable里
美女按你的方法。实例化之后,把删除的row放到DataTable 怎么放的啊。我不会

我是初学者,希望大家能多多帮助我 /bbs/showimg.asp?BoardID=34&filename=2005-4/200542294030151.gif" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://bbs./bbs/showimg.asp?BoardID=34&filename=2005-4/200542294030151.gif');}" onmousewheel="return imgzoom(this);" alt="" />
2005-04-23 09:19
live41
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:67
帖 子:12442
专家分:0
注 册:2004-7-22
收藏
得分:0 
dataTable.Row[int].Delete();  //int是索引值

不知道有没有这个,没经过调试。
2005-04-23 12:13
kaka0368
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2005-4-23
收藏
得分:0 
谢谢,这正是我最近所做的项目需要的。

我是初学者。请多多照顾!
2005-04-23 22:28
kaka0368
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2005-4-23
收藏
得分:0 
不行啊,怎么回事,编译不通过,为什么?

我是初学者。请多多照顾!
2005-04-24 21:13
快速回复:[求助]按Button删除DataGrid里的一行
数据加载中...
 
   



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

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