在ASP.Net中,用VB.net写代码,怎么取得到的记录集中的记录个数啊?

badelf 2003-09-13 11:00:34
在ASP.Net中,用VB.net写代码,怎么取得到的记录集中的记录个数啊?
...全文
70 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
树猫 2003-09-13
  • 打赏
  • 举报
回复
这样就无法直接取得其行数了
除非你自己写个函数
从头检测到尾,记下它的行数
webdiyer 2003-09-13
  • 打赏
  • 举报
回复
DataReader只是一个几前的指针,本身并不包含任何数据,要取得数据表中的记录总数,可以填充一个DataSet或DataTable。
badelf 2003-09-13
  • 打赏
  • 举报
回复
我是这样写的:

myconn= New OleDbConnection(ConfigurationSettings.AppSettings("DataServer"))
myconn.open()
dim expand=request.querystring("expanded")
dim sql="select Departid from t_dict_depart"
Dim mycomm As New oledbcommand(sql,myconn)
Dim rs As oledbdatareader = mycomm.executereader()

这样能取记录集中记录的个数吗?
树猫 2003-09-13
  • 打赏
  • 举报
回复
这些问题,查查.net帮助就好,有详细的内容
树猫 2003-09-13
  • 打赏
  • 举报
回复
DataTable.rows.count
这是第六版的介绍《ASP.NET 4入门经典:涵盖C#和VB.NET(第6版)》内容简介:ASP.NET是.NET Framework的一部分,用于构建内容丰富的动态Web站点。其最新的版本ASP.NET 4对上一版进行了许多改进,包括增强了Web窗体,并添加了jQuery的支持。《ASP.NET 4入门经典:涵盖C#和VB.NET(第6版)》循序渐进,逐步讲解了如何使用ASP.NET 4构建内容丰富的Web站点,并提供了大量使用C#和VB的示例。通过实际动手练习,您将学到关于构建Web站点的第一手信息,同时能够深刻理解在浏览器查看ASP.NET 4页面时,后台到底发生了什么。 这是第七版,也就是本源码书的介绍 The ultimate programming guide to ASP.NET 4.5, by popular author and Microsoft MVP Imar Spaanjaars Updated for ASP.NET 4.5, this introductory book is filled with helpful examples and contains a user-friendly, step-by-step format. Written by popular author and Microsoft ASP.NET MVP Imar Spaanjaars, this book walks you through ASP.NET, Microsoft's technology for building dynamically generated web pages. This edition retains the highly accessible approach to building the Planet Wrox website example, an online community site featuring product reviews, picture sharing, bonus content for registered users, and more. Contains the comprehensive guide to the latest technology additions to ASP.NET 4.5 Shows how to build basic ASP.NET web pages and configure their server Includes information on how to add features with pre-built server controls Reveals how to design pages and make them consistent Contains the information needed for getting user input and displaying data Beginning ASP.NET 4.5 in C# and VB uses Spaanjaars's distinct writing style to put you at ease with learning ASP.NET 4.5.

62,025

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

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