I would like to know is there any way to declare a variable in setting.setting file to hold my connection string. then i can read it from there for example:
properties.settings.default.connectionstring
thanks
Add the setting in the Settings tab in the properties of your project. Make sure it's User scope, not Application scope or it will be read only. Then access it using Settings.Default.ConnectionString
Just keep in mind that this isn't "secure" if that is your goal. Just makes it easier to change at runtime vs a config file. Note that the settings are actually stored in the config file.
Is there a problem using the recommended (web/app).config to hold connection strings?
connectionStringssection in the.configfile is not good enough?.configfile.