Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
rtutus
Aged Yak Warrior
522 Posts |
Posted - 2006-02-17 : 14:46:06
|
I have a form that diplays the information of an account (account number, name, address, contact, discount, taxes, balance, province, civility (Mr., Mrs, Dr..), Billing Code...)And on the same form I need to populate some combo boxes from look up tables in case the user wants to change some codes. Ex: if the user wants to change the Province (QC instead of ON), or change the civility (Mrs instead of Mr), or if he wants to change Billing code (code 5 instead of code 3) and so on... So I have many look up tables in the same form.What s the best way to populate those comboboxes in order to have the best performance: using regular dataset, datareader or do we have some caching mecanism to store them at the begining of launching the aplication locally in the memory, since those look up tables don t change and since the application is used by hundreds of users at the same time which makes it not good idea to access to the tables each time.Thanks |
|
DustinMichaels
Constraint Violating Yak Guru
464 Posts |
Posted - 2006-02-17 : 15:09:13
|
You could probably create a data table or data set to store the lookup table results and cache this data table or data set. Whenever you go to bind the results to the drop down list you would check to see if the results are in the cache. If they are then you bind the cached version to the drop down list, else you get the results from the database, cache it, and then bind the results to the drop down list. |
 |
|
rtutus
Aged Yak Warrior
522 Posts |
Posted - 2006-02-17 : 19:07:49
|
what mechanism do we have to implement this caching in VB.net. Any code exampleThanks |
 |
|
DustinMichaels
Constraint Violating Yak Guru
464 Posts |
Posted - 2006-02-17 : 19:16:45
|
I think the namespace is System.Web.Caching.Cache. Try looking up that object. Also I think the Page object has a Cache property that you can use directly.Heres an exampleif(Cache[<your key>] == null){ ...Get contents out of database and put them into a datatable or dataset. Cache.Add(<your key>, dataSet, ...);}dropDownList.DataSource = Cache[<your key>];dropDownList.DataBind(); The code will probably be something like this. |
 |
|
|
|
|
|
|