select得到的记录的数目如何得到???

phonlee 2003-03-29 10:55:18

我现在使用while(reader.read())
感觉特别麻烦。

大家看看如何解决??
...全文
77 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
yessie 2003-03-29
  • 打赏
  • 举报
回复
返回的recordset.count
psxfghost 2003-03-29
  • 打赏
  • 举报
回复
二者区别很大:
select count (*) from tTask:返回的是检索的到的所有记录的行记录数
select count (字段名) from tTask 返回的也是检索的到的所有记录的行记录数

select * from tTask:返回的是你搜索到的结果集
select 字段名 from tTask 返回的就是要检索的字段的所有记录的结果集
glboy 2003-03-29
  • 打赏
  • 举报
回复
select count (*) from tTask:返回的是检索的到的所有记录的行记录数

select * from tTask:返回的是你搜索到的结果集

你的行数的统计可以通过datagrid或dataset来统计得到
phonlee 2003-03-29
  • 打赏
  • 举报
回复
select count (*) from tTask
select * from tTask

好像没有什么区别??
贝贝壳壳 2003-03-29
  • 打赏
  • 举报
回复
select * from man
select @@rowcount
thinkingforever 2003-03-29
  • 打赏
  • 举报
回复
ok
phonlee 2003-03-29
  • 打赏
  • 举报
回复
可以满足要求

那么,我的sql语句同时要求得到返回的记录集 如何做??
贝贝壳壳 2003-03-29
  • 打赏
  • 举报
回复
select count(*) from table
hansheng 2003-03-29
  • 打赏
  • 举报
回复
你看一下是不是这样的.

SQL="select Count(*) from DWRW";
this.Comm.Connection=this.Conn;
this.Comm.CommandText=SQL;
int count=(int)this.Comm.ExecuteScalar();

110,549

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧