Link to home
Start Free TrialLog in
Avatar of ayha1999
ayha1999

asked on

Cleaning dataset

Hi,

How can I empty a dataset in asp.net 4 with c#?

ayha
ASKER CERTIFIED SOLUTION
Avatar of theSAPPHIRE
theSAPPHIRE

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nishant joshi
Dataset dt=new Dataset();
dt.clear();

Above answers are true if you want to remove only data rows, as Clear removes all rows in all tables but not the tables.
 
So, in order to remove a table you should say:  ds.Tables.Remove("TableName")

-Rahul Gade