A VS 2010 data object model with a database alias generates a connection string in an instance that is not an alias

I have a Silverlight application using the Entity Framework. When I add a data connection in the server explorer (Visual Studio 2010), I provide an "alias" for my database as the server name. After checking the connection and clicking the "OK" button, the connection appears in the "Data Connections" list, but it is not indicated in the "alias". It appears as "ComputerName \ Instance.DatabaseName.dbo". This in itself is not a problem, but when I generate the entity classes, the connection string added to the web.config file lists the name "ComputerName \ Instance" as the server, and not the "alias". This is not a problem for me, but when other developers pull my web.config file from the source control,they cannot connect to their local copy of the database without changing the web.config file. It really doesn't matter, but it is annoying. Does anyone know how to make him use an alias all over?

Thank,

Martin

+3
source share
1 answer

It is enough to change the connection string in web.config after creating the entity model.

0
source

Source: https://habr.com/ru/post/1793901/


All Articles