实体框架的连接字符串对于SQL Server而不是Sqlexpress [英] Connection string for Entity framework For SQL server not for Sqlexpress

查看:87
本文介绍了实体框架的连接字符串对于SQL Server而不是Sqlexpress的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在本地计算机中,我具有用于实体框架DB的sqlexpress,并使用了以下连接字符串.

<add name="PUBSEntities" connectionString="metadata=res://*/Models.Pubs.csdl|res://*/Models.Pubs.ssdl|res://*/Models.Pubs.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\PUBS.MDF;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" /> 



工作正常.但是在开发服务器中,部署时没有SQL Express,只有SQL Server.我可以使用什么连接字符串.我尝试了但没有工作.

解决方案

很遗憾,我们不能告诉您连接字符串应该是什么,但我们不能有信息.您需要自己构建它.这是一个方便的参考: http://www.connectionstrings.com/ [



Working fine. But in development server while deploying there is no SQL Express only SQL Server is there. What connection string i can use. I tried but not working. Can you please help me?

解决方案

Unfortunately, we can''t tell what your connection string should be, we don''t have the information. You''ll need to build it yourself. This is a handy reference: http://www.connectionstrings.com/[^]

More than likely the forms you will need are:

Data Source=serverNameOrIP;Initial Catalog=databaseName,;User Id=username;Password=password;



Which covers SQL authentication, or for windows authentication:

Data Source=serverNameOrIP;Initial Catalog=databaseName;Integrated Security=SSPI;



If you have a DB admin he/she should be able to give you the values in italics


这篇关于实体框架的连接字符串对于SQL Server而不是Sqlexpress的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆