[英]ASP.NET MVC 3 app cannot connect to SQL server 2008 instance on AWS instance
When running an ASP.NET MVC 3 app (written in VS 2010, tested and working using SQL Server Express 2012, .NET 4.0, Windows 7 Pro) on an Amazon Web Services host (Windows Server 2008, ASP.NET 4.0 app pool, SQL Server Express 2008, IIS7), I am unable to connect to the local database on that machine, nor see any errors in connecting. 在Amazon Web Services主机(Windows Server 2008,ASP.NET 4.0应用程序池)上运行ASP.NET MVC 3应用程序(用VS 2010编写,经过测试并使用SQL Server Express 2012,.NET 4.0,Windows 7 Pro并能正常工作)时, SQL Server Express 2008,IIS7),我无法连接到该计算机上的本地数据库,也看不到任何连接错误。 I am using the following ConnectionString in Web.config:
我在Web.config中使用以下ConnectionString:
name="DefaultConnection" connectionString="Data Source=.;Initial Catalog=aspnet-NewWebSite-20141030101548;Integrated Security=SSPI" providerName="System.Data.SqlClient" name =“ DefaultConnection” connectionString =“ Data Source = .;初始目录= aspnet-NewWebSite-20141030101548; Integrated Security = SSPI” providerName =“ System.Data.SqlClient”
Is there a modification I should make to this to make it work? 我应该对此进行修改以使其起作用吗? I can't upgrade to SQL Server 2012 on this AWS instance.
我无法在此AWS实例上升级到SQL Server 2012。 I can't even log to the Event Viewer or email errors to myself.
我什至无法登录事件查看器或将错误通过电子邮件发送给自己。 I'm stumped.
我很沮丧
Your connection string is pointing to a local db instance, and AWS probably doesn't support LocalDB. 您的连接字符串指向本地数据库实例,并且AWS可能不支持LocalDB。 What you want to do is to get a DB instance that supports remote connection ( you can get one from AWS directly) and find out the connection string of that server, change yours accordingly.
您要做的是获取一个支持远程连接的数据库实例(您可以直接从AWS那里获得一个实例)并找出该服务器的连接字符串,并相应地更改您的服务器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.