Code Comments
Programming Forum and web based access to our favorite programming groups.I've been developing in Delphi since version 1.0. I justed picked up Visual Studio ASP.NET 2003 Architect and had a couple of questions that I hope somebody can help with: 1. In Delphi, I can place all of my database connectivity items on a single Datamodule unit and then refer to them from any other place in the application. Is there a similar construct in VS? 2. What is the accepted/safest way to store connectivity settings to ADO Connection Strings? Is it "safe" to place them in Web.Config? 3. Can anybody recommend a good third-party tool for creating menu constructs in ASP.NET? TIA -- Mark A. Deal Document & Data Solutions, LLC http://www.docsol.com Time Matters AIC HotDocs Certified Consultant GhostFill Certified Consultant
Post Follow-up to this message>1. In Delphi, I can place all of my database connectivity items on a single >Datamodule unit and then refer to them from any other place in the >application. Is there a similar construct in VS? No, not out of the box. You will need to non-visually create a class that holds all your database objects - but it's non-visual (and not very intuitive, either!). Or you can just use a regular Windows form, and just keep it hidden (again - rather kludgy.......) >2. What is the accepted/safest way to store connectivity settings to ADO >Connection Strings? Is it "safe" to place them in Web.Config? Since connection strings are something that rarely changes (and most definitely not during runtime), yes, you could place them in the web.config file. You might want to not store the whole string, though, but only the DB server name and database name (for instance). And I'd definitely recommend *NOT* storing user names and passwords in web.config! Marc ======================================== ======================== Marc Scheuner May The Source Be With You! Bern, Switzerland m.scheuner(at)inova.ch
Post Follow-up to this messageThank you. So, what is the accepted way to store the connection string user names and passwords? Thanks! -- Mark A. Deal Document & Data Solutions, LLC http://www.docsol.com Time Matters AIC HotDocs Certified Consultant GhostFill Certified Consultant > Since connection strings are something that rarely changes (and most > definitely not during runtime), yes, you could place them in the > web.config file. You might want to not store the whole string, though, > but only the DB server name and database name (for instance). And I'd > definitely recommend *NOT* storing user names and passwords in > web.config! > > Marc > ======================================== ======================== > Marc Scheuner May The Source Be With You! > Bern, Switzerland m.scheuner(at)inova.ch
Post Follow-up to this message>Thank you. So, what is the accepted way to store the connection string user >names and passwords? Don't - ask the user for the server / database he wants to use, and prompt for user name / password. If you absolutely have to store these things, either store them system-wide in web.config or the app's config file (preferably as little info as possible, e.g. only server and DB name), or on a per-user basis in the user's "isolated storage" - read up the MSDN docs on isolated storage. Marc ======================================== ======================== Marc Scheuner May The Source Be With You! Bern, Switzerland m.scheuner(at)inova.ch
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.