开发者

VS 2010 Data Entity Model with database Alias generates connection string on Instance not Alias

I have a Silverlight application using Entity Framework. When I add a Data Connection i开发者_开发知识库n Server Explorer (Visual Studio 2010) I provide the “alias” for my database as the Server Name. After testing the connection and clicking OK, the connection appears under Data Connections list, but it is not listed under the “alias”. It appears listed as “ComputerName\Instance.DatabaseName.dbo”. That in itself is not a problem, but when I generate my entity classes, the connection string that is added to the web.config file lists the “ComputerName\Instance” as the server, rather than the “Alias”. This is not a problem for me, but when other developers pull my web.config file out of source control they can’t connect to their local copy of the database without changing the web.config file. It really isn’t a big deal, but it is annoying. Does anyone know how to get it use the Alias name all the way through?

Thanks,

Martin


It should be enough to modify connection string in web.config after you generate your entity model.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜