If I have several pages what would be the correct procedure in creating a connection string variable and sharing it among all of my pages. I would prefer not to type the connection string 100 times for each page and would just rather call it. Can I create it in my namespace or whats the best approach?
Share
Put the connection string in the web.config file. See the following on MSDN: How to: Read Connection Strings from the Web.config File
Example of connection string in config:
Using the string: