实体框架连接字符串 [英] entity framework connection string

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

问题描述

 <   add    名称  =  ABCCarcareEntities    connectionString   = 元数据= RES://*/DataAccess.ABCCarcare.csdl | RES://*/DataAccess.ABCCarcare.ssdl | RES://*/DataAccess.ABCCarcare.msl;提供商=系统。 Data.SqlClient; provider connection string = 数据   来源  =   117.121.0.201;初始 目录  =   ABCCarcare_uat;持久 安全   信息  =   True ; user   id   =   ABCstages; password = ABCstages; MultipleActiveResultSets = True     providerName   =  System.Data.EntityClient  /  >  





这是我的连接字符串我目前的申请。我可以将它从我的本地PC连接到远程数据库,但是当我在服务器上部署它时,它无法访问sqlserver 2012上的数据库。请帮助

解决方案

< pre lang =xml>好吧我发现它不是因为连接字符串,不同版本的iis
< 有不同的设置 pre lang = HTML >
<! - 对于IIS 7.0 - >
<! - =========================================== === - >
< span class =code-comment><! - < system.webServer>
< handlers>
< add name =ajaxhandlerverb =*path =* .ashxtype =AjaxPro.AjaxHandlerFactory,AjaxPro.2/>
< / handlers>
< /system.webServer>
- >

<! - 对于IIS 6.0 - > ;
<! - ============================================== - >
< system.web >
< httphandlers >
< add 动词 = * 路径 = * .ashx type = AjaxPro.AjaxHandlerFactory,AjaxPro.2 / < span class =code-keyword>>
< / httphandlers >
< / system。网站 >


<add name="ABCCarcareEntities" connectionString="metadata=res://*/DataAccess.ABCCarcare.csdl|res://*/DataAccess.ABCCarcare.ssdl|res://*/DataAccess.ABCCarcare.msl;provider=System.Data.SqlClient;provider connection string="Data Source=117.121.0.201;Initial Catalog=ABCCarcare_uat;Persist Security Info=True;user id=ABCstages;password=ABCstages;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient"/>



Hi this is my connectionstring for my current application. i can connect it from my local pc to the remote database, but when i deploy it on the server it cannot access the database on sqlserver 2012. please help

解决方案

ok i found out it was not because of the connection string, there is a different setting for different versions of iis
<pre lang="HTML">
  	<!-- For IIS 7.0-->
		<!-- ============================================== -->
		<!--<system.webServer>
			<handlers>
				<add name="ajaxhandler"  verb="*" path="*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/>
			</handlers>
		</system.webServer>-->
		<!-- For IIS 6.0-->
		<!-- ============================================== -->
		<system.web>
			<httphandlers>
				<add verb="*" path="*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2" />
			</httphandlers>
		</system.web>


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

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