A first time in an ASP.NET application.

G

Guest

Hello All,
I've run into something I've never had to worry about in all the asp.net
applications I've created so far. Up until now every database application
I've created has had database username/password info compiled right into the
app. Not the best way to do it but it fit the requirements since special
database users where created just for each of the apps.

However, now I have an application that is going to be sold to other
companies and this method isn't going to work for me. I need to have that
username / password / server info stored in a different location so it can be
modified by a configuration aspx page. I'm storing all other config setting
IN the database. But where would be the best place to store the database info
so it to can be easily modified? Even if it's like the old asp.net system
where the global.asa file was plain text and it could be store in there and
edited by hand would be ok.

Thanks a lot!

Regards,
-Tony
 
S

Scott Allen

If you are using ASP.NET 2.0, you can use the built in configuration
system to read, write, and encrypt configuration settings.

I have an article on the features here:
http://odetocode.com/Articles/418.aspx


In 1.x you can still easily read the web.config file, but it's a
little more difficult to write. You'll need to manipulate the XML
yourself (like with the XmlDocument class), and your application will
restart if web.config changes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top