473,378 Members | 1,344 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,378 software developers and data experts.

How to check if a dataset is empty?

Hello,

I have am connecting a datagrid to a dataset:
dgProducts.DataSource = dsProducts()

dsProducts is a function which returns a dataset.

How can I detect if the dataset which is being returned is empty?

Thanks,
Miguel

Nov 19 '05 #1
1 1618
You can use dsProducts().Tables.Count to check how many tables are in the
returned dataset. Alternatively, if you want to check if any rows are
returned in a specific table, you could use something like
dsProduts.Tables[0].Rows.Count.

Mun

--
Munsifali Rashid
http://www.munit.co.uk/blog/

"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Hello,

I have am connecting a datagrid to a dataset:
dgProducts.DataSource = dsProducts()

dsProducts is a function which returns a dataset.

How can I detect if the dataset which is being returned is empty?

Thanks,
Miguel

Nov 19 '05 #2

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

Similar topics

2
by: Andreas Palm | last post by:
I have a dataset that has DBNull in certain columns, now when I write out this one to XML, I only get the columns as elements that do have data in it. However I do need also the empty colums as...
1
by: John | last post by:
Hi All, When I delete the last record from my dataset and then WriteXML() to the file; the Table itself, in the xml file, is removed. I need to prevent the table structure from being deleted if...
1
by: Sebastian Santacroce | last post by:
How do I check if dataset.Tables("somename") has been set? ie if dataset.Tables("somename").exists ...or if dataset.Tables("somename").empty ... or if dataset.Tables("somename") is null... ...
19
by: Dave | last post by:
If Iwant to check if dataset1.SelectQuery1.column1 == System.DBNull.Value. How do I do this? What I wrote above will give an error. -- L. A. Jones
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.