Hi,
I am doing a sample VS 2008 project.
I have added a dbml file.On the designer,I have dragged a table "emp" from a database "Employee" which is in my server(for example Server1).
It created an app.config with connection string as
<connectionStri ngs>
<add name="LinQ2008. Properties.Sett ings.EmployeeConnect ionString"
connectionStrin g="Data Source=Server1; Initial Catalog=Employe e;User ID=abc;Password =somepassword"
providerName="S ystem.Data.SqlC lient" />
</connectionStrin gs>
Next,I have added another dbml file.On the designer,I have dragged a table from a database "Employee" which is in a diffferent server(for example Server2).
Now in app.config the connection string is created as
<connectionStri ngs>
<add name="LinQ2008. Properties.Sett ings.EmployeeConnect ionString1"
connectionStrin g="Data Source=Server2; Initial Catalog=Employe e;User ID=xyz;Password =somepassword"
providerName="S ystem.Data.SqlC lient" />
</connectionStrin gs>
My doubt is
(1) When two datasources/servers having same database name(for example Employee) are there,then if we drag a table from Employee database from "Server1", a connection string is created as "EmployeeConnec tionString" in app.config.
If we drag a table from Student database from "Server2", another connection string is created as "EmployeeConnec tionString1" in app.config.
How to have a common connectionstrin g name instead creating different connection strings.
Thanks,
Silpa
I am doing a sample VS 2008 project.
I have added a dbml file.On the designer,I have dragged a table "emp" from a database "Employee" which is in my server(for example Server1).
It created an app.config with connection string as
<connectionStri ngs>
<add name="LinQ2008. Properties.Sett ings.EmployeeConnect ionString"
connectionStrin g="Data Source=Server1; Initial Catalog=Employe e;User ID=abc;Password =somepassword"
providerName="S ystem.Data.SqlC lient" />
</connectionStrin gs>
Next,I have added another dbml file.On the designer,I have dragged a table from a database "Employee" which is in a diffferent server(for example Server2).
Now in app.config the connection string is created as
<connectionStri ngs>
<add name="LinQ2008. Properties.Sett ings.EmployeeConnect ionString1"
connectionStrin g="Data Source=Server2; Initial Catalog=Employe e;User ID=xyz;Password =somepassword"
providerName="S ystem.Data.SqlC lient" />
</connectionStrin gs>
My doubt is
(1) When two datasources/servers having same database name(for example Employee) are there,then if we drag a table from Employee database from "Server1", a connection string is created as "EmployeeConnec tionString" in app.config.
If we drag a table from Student database from "Server2", another connection string is created as "EmployeeConnec tionString1" in app.config.
How to have a common connectionstrin g name instead creating different connection strings.
Thanks,
Silpa