如何配置RDS实例(MSSQLServer Express)的连接字符串

本文关键字:Express 连接 字符串 MSSQLServer RDS 何配置 配置 实例 | 更新日期: 2023-09-27 18:12:09

我已经使用management Studio从我的PC连接到我的实例RDS (MSSQL Server Express),没有问题,因为我已经配置了策略组和其他东西。

我的"简单"问题是,当我试图从我的WebApp连接,我有一个web。配置,这是我的配置在ASP。NET MVC 5项目…很简单:

你能帮我正确配置我的连接字符串吗?

谢谢! !

<add name="Entities" connectionString="metadata=res://*/Business.Interactive.Model.csdl|res://*/Business.Interactive.Model.ssdl|res://*/Business.Interactive.Model.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=aa1XXXXXXXXXbi.cruXXXXXXym4.eu-west-1.rds.amazonaws.com:1433;Database=Business.interactive.gci;User Id=userroot;
Password=XXXXXXXX;pooling=False;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
<add name="myBusinessContext" connectionString="Data Source=aa1XXXXXXXXXbi.cruXXXXXXym4.eu-west-1.rds.amazonaws.com:1433;Database=Business.interactive.gci;User Id=userroot;
Password=XXXXXXXX;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />

如何配置RDS实例(MSSQLServer Express)的连接字符串

好的,问题是数据库名称的长度,我还必须删除数字端口:

最后

:

<add name="Entities" connectionString="metadata=res://*/Business.Interactive.Model.csdl|res://*/Business.Interactive.Model.ssdl|res://*/Business.Interactive.Model.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=aa1XXXXXXXXXbi.cruXXXXXXym4.eu-west-1.rds.amazonaws.com;Database=Businessgci;User Id=userroot;
Password=XXXXXXXX;pooling=False;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
<add name="myBusinessContext" connectionString="Data Source=aa1XXXXXXXXXbi.cruXXXXXXym4.eu-west-1.rds.amazonaws.com;Database=Businessgci;User Id=userroot;
Password=XXXXXXXX;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />

的问候! !