Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ClearOnFill parameter for FillDataSet()
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00816068
Message ID:
00816710
Views:
17
ds.Tables.Clear() clears all the tables in the dataset. There are just too many side effects. It is highly doubtful that this is what you want to do if you are retrieving multiple tables into a dataset.

Example: we retrieve a selective list of columns for all orders for a customer into a dataset, the user selects one, and then we retrieve just the selected order into another table in the same dataset. We don't want to clear all tables when the selected order is retrieved. Another example: you retrieve a lookup table into a dataset. Then you retrieve more records into another table and set a relation into the lookup table. When you requery the table you don't want to clear the lookup tables.

If you always want to blow away the tables just call GetDataSet instead of FillDataSet.

>If I can call ds.Tables.Clear() to clear the table collection first, would it make sense MM.NET can do that too?
>
>Stephen
>
>
>>When you think about it, how can MM.NET really know how may tables are returned from your stored procedure? I agree that it would probably be a good enhancement for the framework but might take some fancy footwork to get the coding right.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform