Get connection string from Settings.settings file
Posted on 2006-07-21
I have 3 connection strings stored in my Settings.settings file and I would like to refer to one of them from code rather than re-typing the string.
The code is:
SqlCommand sqlcmd = new SqlCommand(mySqlString, System.Configuration.[something?])
The name of the connection string I want is dbJobRegisterConnectionString.
Also, however it is done, can I access it in a tightly typed fashion, rather than having to type something.something["dbJobRegisterConnectionString"] if you know what I mean?
Thanks in advance.