how to write connection string for two databases in asp.net with c#
-
from one sqlsever2000 i have two database employeedb and companydb .how to create the connection string for this using asp.net with c#. give me simple example not a query.
-
from one sqlsever2000 i have two database employeedb and companydb .how to create the connection string for this using asp.net with c#. give me simple example not a query.
developerit wrote:
from one sqlsever2000 i have two database employeedb and companydb
You have to create 2 connection strings in web.config file..! or if You have to use it in code get the data source dynamically. but its a bad idea to give connection string in code..! Here is a link for connection strings..! http://www.connectionstrings.com/[^]
LatestArticle :Log4Net Why Do Some People Forget To Mark as Answer .If It Helps.
-
from one sqlsever2000 i have two database employeedb and companydb .how to create the connection string for this using asp.net with c#. give me simple example not a query.
You already asked this and got a good answer. Did you not understand the answers?
Tychotics: take us back to the moon "Life, for ever dying to be born afresh, for ever young and eager, will presently stand upon this earth as upon a footstool, and stretch out its realm amidst the stars." H. G. Wells
-
You already asked this and got a good answer. Did you not understand the answers?
Tychotics: take us back to the moon "Life, for ever dying to be born afresh, for ever young and eager, will presently stand upon this earth as upon a footstool, and stretch out its realm amidst the stars." H. G. Wells
before the community was posted is the querry but i want the connection string for two database using asp.net with c#, can you give a simple example
-
from one sqlsever2000 i have two database employeedb and companydb .how to create the connection string for this using asp.net with c#. give me simple example not a query.
why do u use 2 connection strings. U create a login which has the access of two databases.and mention the login in your connection string.
-
developerit wrote:
from one sqlsever2000 i have two database employeedb and companydb
You have to create 2 connection strings in web.config file..! or if You have to use it in code get the data source dynamically. but its a bad idea to give connection string in code..! Here is a link for connection strings..! http://www.connectionstrings.com/[^]
LatestArticle :Log4Net Why Do Some People Forget To Mark as Answer .If It Helps.
the site http://www.connectrings.com is giving idea for single connection string....i want for two connection string, can you give simple example
-
the site http://www.connectrings.com is giving idea for single connection string....i want for two connection string, can you give simple example
developerit wrote:
i want for two connection string,
What do u mean by tht..! You need to add 2 connection strings in web.config file..!
<appSettings> <add key="connectionString1" value="User Id=User ID;password=XXXX;Initial Catalog=company;Data Source=Name;Packet Size=4096"/>
<add key="connectionString2" value="User Id=User ID;password=XXXX;Initial Catalog=employee;Data Source=Name;Packet Size=4096"/> </appSettings>Then If u want to call thr code..!if u want to call first connection string specify the name in the value like ConnectionString1/Connectionstring2
ConfigurationSettings.AppSettings["ConnectionString1"]; ConfigurationSettings.AppSettings["ConnectionString2"];
LatestArticle :Log4Net Why Do Some People Forget To Mark as Answer .If It Helps.
-
before the community was posted is the querry but i want the connection string for two database using asp.net with c#, can you give a simple example
If you can't get it form all the information you have been given you are in the wrong job. Read through all of the posts again: it is all there.
Tychotics: take us back to the moon "Life, for ever dying to be born afresh, for ever young and eager, will presently stand upon this earth as upon a footstool, and stretch out its realm amidst the stars." H. G. Wells