C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » .NET Framework »

Tips in VB.NET - Tip #7


Posted Date: 21 Mar 2004    Resource Type: Articles    Category: .NET Framework
Author: Sadha SivamMember Level: Gold    
Rating: 1 out of 5Points: 4



Tips in VB.NET - Tip #7

How to display Message when no datas are contained in the dataset

Many of us might be working on datasets, assigning the dataset to the datagrid. And some times we may require some message to be displayed when there is no data stored in the dataset.

I found many people asking this question in various .Net user groups.

Dataset is a collection of DataTable. A dataset is capable of storing multiple resultsets. Each result set is stored as a datatable (tables collections) in the dataset. And a data table is composed of data rows( a rows collection).

There are two possibilites of not getting data.


  • When no resultset are returned.


  • When no data row is contained in the data table



When no resultset are returned.
This means that there will not be any data table in the data set. So we can use the count property and check whether the dataset contains any data table or not.

Example

'ds is the dataset.
if ds.tables.count = 0 then
'No result set is found
End If


When no data row is contained in the data table.
This means that there is no data returned. This can be checked by using the count property of the rows collection in the datatable.

Example,

'ds is the dataset
If ds.tables(0).rows.count = 0 then
'no row is returned
End If





Note
This hold good for both C#, VB.Net


Please send me your suggestion and feedback to sadhasivam1981@yahoo.com.

Please vist http://sadhasivam.t35.com



Every Features has a purpose

Finding it leads to great benefits








Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Tips in VB.NET - Tip #6
Previous Resource: Connecting to Database and accessing the records in C#
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use