Click here to Skip to main content
15,940,271 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all,

I have created a service with LINQ to SQL. In my own computer for the .dbml class (LINQ to SQL class) from the Server Explorer I have found the database, drag and dropped it to the class. So now VS created the connection strings automatically for me. I see that in my Settings.seetings and app.config files i can see the connection. The problem arises here for me:

I will also use this project in the production server. I went ahead and changes my connection strings from these files and in couple more.

my previous connection string was:
C#
connectionString="Data Source=PC36\SQLEXPRESS;Initial Catalog=RMA_DB;"


so to make the project work in each computer i have changed this conenction string to;

C#
connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=RMA_DB;"


But somehow it is still reading the values from my first connection. I have searched where VS uses this connection string and changed each one but i dont know why the project is not using the installed computer's DB instead of mine. Can someone point me out where I did wrong? Thanks
Posted

1 solution

Hi,

Try this format if could help...
Example:
XML
<add name="connectionString1" connectionString="Data Source=211.9.0.91\RMA_DB;Initial Catalog=RMA_DB;User ID=DataBaseUserID;Password=DataBasePassword" providerName="System.Data.SqlClient"/>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900