473,396 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

checking for 0 records in a table

How can I check for the number of records in a table?

If MyDataSet1.Table1.recordcount = 0
'my code'
End If

--
_____
DC G
Nov 18 '05 #1
4 958
MyDataSet1.Tables[0].Rows.Count

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"DC Gringo" <dc******@visiontechnology.net> wrote in message
news:ez**************@TK2MSFTNGP09.phx.gbl...
How can I check for the number of records in a table?

If MyDataSet1.Table1.recordcount = 0
'my code'
End If

--
_____
DC G

Nov 18 '05 #2
MyDataSet1.Table1.Rows.Count

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"DC Gringo" <dc******@visiontechnology.net> wrote in message
news:ez**************@TK2MSFTNGP09.phx.gbl...
How can I check for the number of records in a table?

If MyDataSet1.Table1.recordcount = 0
'my code'
End If

--
_____
DC G

Nov 18 '05 #3
DC Gringo <dc******@visiontechnology.net> typed:
How can I check for the number of records in a table?

If MyDataSet1.Table1.recordcount = 0
'my code'
End If


Try this:

If MyDataSet1.Tables("Table1").Rows.Count = 0 Then
'your code here
End If

--
Davide Vernole
MVP ASP/ASP.NET
Microsoft Certified Solution Developer
Nov 18 '05 #4
Use DataTable.Rows.Count property.

"DC Gringo" <dc******@visiontechnology.net> wrote in message
news:ez**************@TK2MSFTNGP09.phx.gbl...
How can I check for the number of records in a table?

If MyDataSet1.Table1.recordcount = 0
'my code'
End If

--
_____
DC G

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: JS | last post by:
I have set up db2audit for checking on win2k v8 db, but when I extract the records from the log and load them into the checking table, I don't get the object name in objname colum. My understanding...
5
by: Jermin | last post by:
Hi, I have a database composed of a single table composed of 2 columns, an auto-numbered ID column and a column which contains 30 million random numbers. All I want to Access to do is check the...
8
by: J-P-W | last post by:
Hi, anyone got any thoughts on this problem? I have sales reps. that remotely send their data to an ftp server. The office downloads all files, the code creates an empty file, then downloads the...
2
by: hakkatil | last post by:
Hi to all, I have a page that inserts excel sheet to access database. I am using asp. What I want to do is to check the inserting record if it is in the database. Basicly checking the dublicate...
2
by: padmaneha | last post by:
There are two tables in our database Businessmaster and locationmaster Businessmaster has the following fields like contentid, businessname, businesstype, location, city, state, country, zipcode,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.