>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.
Your code is Ok, that's the right way of testing if table "MyTable" exists in dataset MyDataset (and it usually works!)
What problem do you have?
If the expression is always returning false ==> the table does not exist, at least with that name.
If the expression causes an exception, ==> MyDataset is not a valid DataSet object at that point...
Regards
Jose.