473,386 Members | 1,860 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,386 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 21 '05 #1
8 1094
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 21 '05 #2
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 21 '05 #3
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 21 '05 #4
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 21 '05 #5
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 21 '05 #6
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 21 '05 #7
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 21 '05 #8
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 21 '05 #9

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

Similar topics

8
by: tom | last post by:
I am new to SQL administration. >From a list of IDs that are the primary key in one table (i.e. Customer Table), I want to make changes in tables that use those IDs as a foreign key. ...
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...
1
by: Maxi | last post by:
I have two tables "Data" and "Check" Here is the content of the tables: "Data" "Check" Field1 Field1 Field2 Jack Jill Yes Jill Maxi Yes Dino John ...
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...
10
by: mcbobin | last post by:
Hi, Here's hoping someone can help... I'm using a stored procedure to return a single row of data ie a DataRow e.g. public static DataRow GetManualDailySplits(string prmLocationID, string
0
by: rdemyan | last post by:
Is there a way to check the validity of front-end table links on a backend file where all permissions to data have been revoked. To get at the data, the front end uses RWOP queries. What I'm...
46
by: John | last post by:
Hi How can I check for existence of a certain table by name in and access database and if the table exists find the number of records in it? I guess I can access this information by setting up...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.