Web Hosting Talk







View Full Version : Where to store my application data in asp.net the web.config ot a database


Spire128
10-17-2004, 09:13 AM
Hi all

I am adapting the I buy spy commerce stater kit to work as a department store , so when folks arrive at my dept store front they can select which dept to enter, which will be the commerce starter kit, each dept will be in truth a different client offering there products for sale, so each dept will look completly different
color's image's etc, as I don't wish to or think it is the most efficent way to do it I have not got multiple copies of the commerce kit running but 1 which I set up each time as the correct dept look.

So here it is would the application run quicker if I store the dept data in the web config and use if statments or select case statments to determine which app settings to use, or call the data form the Sql server database which will require a database call each time a form is opened.

I would point out this is nothing to do with the product data as I have that sorted, it is only to do with the shop look and feel the image's logo colors etc that will make each dept look like a different shop.

Also I hope to have between 12 to 24 dept's running on each copy of my site and multiple sites or if it scales well I will just keep adding deptments, so there are likeliy to be dozens of dept's with dozens of peices data per dept, I hope :)

My own feeling is to go for the database option as I feel it would be easier to manage and scale better, but what I am after is the quickest way for the code to run, even if it is difficult to manage.

Thanks

Ricardob
10-17-2004, 10:22 PM
Originally posted by Spire128
Hi all

I am adapting the I buy spy commerce stater kit to work as a department store , so when folks arrive at my dept store front they can select which dept to enter, which will be the commerce starter kit, each dept will be in truth a different client offering there products for sale, so each dept will look completly different
color's image's etc, as I don't wish to or think it is the most efficent way to do it I have not got multiple copies of the commerce kit running but 1 which I set up each time as the correct dept look.

So here it is would the application run quicker if I store the dept data in the web config and use if statments or select case statments to determine which app settings to use, or call the data form the Sql server database which will require a database call each time a form is opened.

I would point out this is nothing to do with the product data as I have that sorted, it is only to do with the shop look and feel the image's logo colors etc that will make each dept look like a different shop.

Also I hope to have between 12 to 24 dept's running on each copy of my site and multiple sites or if it scales well I will just keep adding deptments, so there are likeliy to be dozens of dept's with dozens of peices data per dept, I hope :)

My own feeling is to go for the database option as I feel it would be easier to manage and scale better, but what I am after is the quickest way for the code to run, even if it is difficult to manage.

Thanks

I am not sure I understand well, but certainly you can't use web.config to do that.

in web.config, you define authorization, atuthentication, whether it's debug or final version, track options, etc.

If you want to change the look depending on the department you have to use CSS, you can have multiple CSSs files and load then dynamically depending on the department choosen.

to save logos, my advise is to save them on the harddrive, not on the database which is a pain, you can save the location and name of each logo in an XML or text file, then you can use ADO.net's xml classes to read and write the xml, or the classes in the System.IO namespace for a text file.

unlucky1
10-19-2004, 05:11 PM
You could always add
<appSettings>
<add key="keyname" value="value" />
</appSettings>

to your web.config file, if that's what you mean. Then you could access it with ConfigurationSettings.AppSettings["keyname"]. But, I wouldn't recommend doing it this way as you would need to manually change the web.config file.