Globalized connection string meant for that if you are designing a vast application that having so many windows forms and you need to control all the application using an app.config file.
Home / DeveloperSection / Blogs / Globalized Connection String
Globalized connection string meant for that if you are designing a vast application that having so many windows forms and you need to control all the application using an app.config file.
fuan Edgar
23-Mar-2011you will get this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="GlobalConnectionName" value="Data Source = serverAddress;Initial Catalog = DBName;User Id=xyz; Password=xxxx;"/>
</appSettings>
</configuration>
Now where you want to use this GlobalConnection :
Add "System.Configuration" Namespace
create your connection object:
SqlConnection con=new SqlConnection();
con.ConnectionString = ConfigurationSettings.AppSettings["GlobalConnectionName"];
& you are done......
Anonymous User
15-Mar-2011Can you please give me a example on Globalized connection string.
Thanks
Amit Singh
15-Mar-2011hi awadh,
please check this link on Globalized connection string.
http://www.mindstick.com/Articles/176ace46-e15b-472c-8dda-f4941639f7f6/?Creating%20Globalized%20Connection%20String%20in%20.Net%20Framework%20using%20Attached%20Database