469,300 Members | 2,247 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,300 developers. It's quick & easy.

Regarding Connection string name when a user adds a dbml file

20
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
<connectionStrings>
<add name="LinQ2008.Properties.Settings.EmployeeConnectionString"
connectionString="Data Source=Server1;Initial Catalog=Employee;User ID=abc;Password=somepassword"
providerName="System.Data.SqlClient" />
</connectionStrings>
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
<connectionStrings>
<add name="LinQ2008.Properties.Settings.EmployeeConnectionString1"
connectionString="Data Source=Server2;Initial Catalog=Employee;User ID=xyz;Password=somepassword"
providerName="System.Data.SqlClient" />
</connectionStrings>

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 "EmployeeConnectionString" in app.config.
If we drag a table from Student database from "Server2", another connection string is created as "EmployeeConnectionString1" in app.config.

How to have a common connectionstring name instead creating different connection strings.

Thanks,
Silpa
Mar 13 '08 #1
0 1227

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Paul Robinson | last post: by
reply views Thread by JWM | last post: by
5 posts views Thread by Alec | last post: by
37 posts views Thread by sam44 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.