Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How we check for not empty dataset?
Message
De
08/09/2008 16:50:48
John Baird
Coatesville, Pennsylvanie, États-Unis
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01345899
Message ID:
01345900
Vues:
16
This message has been marked as the solution to the initial question of the thread.
>Hi everybody,
>
>Is there a simple way to check if the dataset is empty? I have a button to copy ds to Excel. However, I want to show some message if ds doesn't have records. Should I get the DataTable first and check RowCount?
>
>Thanks in advance.


if( ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
{
do something here;
}
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform