views:

78

answers:

1

I have a users table where there are two types of users in it, users a and users b. There is a page on my website that shows 20 of each type based on querystring parameter. I want to cache these for 6 hours as their order is not that important.

My question is is it better to have two different SqlDataAdapter calls and two different Datasets to store each type and then Bind() it based on querystring and availability in cache OR to have one Dataset so i can manipulate it with querystring parameter. ( I don't know how to do that).

So again... 1. What is better for performance to have one DS and manipulate it or to have two ? 2.How can i manipulate Dataset, ie. I have column with bit value, for 1 as querystring i want 1 value in Dataset and for 0 or none i want 0 value in Dataset ?

Thanks

+1  A: 

Personally, I would try to limit calls to the database (or any outside resource for that matter). So call once, using one SqlDataAdapter. This gives you a single DataTable with both users a & b. Easiest way to split them apart is to create two DataViews, one for users a and one for users b and bind each DataView to the appropriate control.

How to create DataViews

SystemDown
thanks, Dataview.RowFilter = "type = 'a'" should do. At the end i've used one db call but saved values to two different tables in Dataset instead of using RowFiltering
eugeneK