Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Check if a table exist in a dataset
Message
De
28/10/2002 12:56:02
 
 
À
28/10/2002 07:15:15
Christian Cote
Les Logiciels Onoma Inc.
Longueuil, Québec, Canada
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00715973
Message ID:
00716102
Vues:
22
Christian,

Is the schema of MyTable always the same? I'm guessing that maybe what you want instead is this:
if (MyDataSet.Tables["MyTable"].Rows.Count > 0)
  MyDataSet.Tables["MyTable"].Rows.Clear()
~~Bonnie

>HI,
>I want to fill a atble from specific data based on a parameter. Since the table will contains many queries values, I need to clear it before I use it again. The code I am using is :
>
>if (MyDataset.Tables.Contains("MyTable"))
>{
> MyDataset.Tables["MyTable"].Clear();
>}
>
>The problem is that even if MyTable exists in the dataset, the program never enter the if because it seems that the if condition is wrong.
>
>Is that right?
>
>Thank you for your help,
>Christian
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform