0

I'm using the Visual Studio O/R designer to get my tables from SQL so that I can use LINQ (.dbml file).

Currently it points to my local DB. How will I change this database connection to the client server when I deploy the application? Alternatively, how do I tell the dbml file to read the connection string from the app.config file?

LeftyX
  • 35,328
  • 21
  • 132
  • 193
Cameron Castillo
  • 2,712
  • 10
  • 47
  • 77

1 Answers1

0

Open the DBML designer, in the Properties pane there's an entry that specifies what the connection string is.

The entity context class will have a constructor accepts a connection string argument (the default constructor uses the connection string specified in the DBML). It's up to your application to provide the string in that case, such as reading from App.config.

Dai
  • 141,631
  • 28
  • 261
  • 374