简体   繁体   English

ASP.NET MVC 3应用程序无法连接到AWS实例上的SQL Server 2008实例

[英]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.

相关问题 ASP.net应用程序无法连接到SQL Server命名实例 - ASP.net application unable to connect to SQL Server named instance 尝试连接 SQL 服务器和 ASP.NET MVC mvc 应用程序 - Trying connect SQL Server and ASP.NET MVC mvc app 无法从 Docker (Linux) 中运行的 ASP.NET Core 连接到 SQL Server 命名实例 - Can't connect to SQL Server named instance from ASP.NET Core running in Docker (Linux) ASP.Net MVC-“无法创建接口实例” - ASP.Net MVC - “Cannot Create Instance of an Interface” ASP.NET Core MVC 2:服务器端的NameValueCollection实例为空 - ASP.NET Core MVC 2: NameValueCollection instance is empty on the server side ASP.NET MVC 4 EF6 无法连接到 SQL Server Express 数据库 - ASP.NET MVC 4 EF6 cannot connect to SQL Server Express database ASP.NET MVC 无法连接到我的本地 SQL Server 数据库 - ASP.NET MVC cannot connect to my local SQL Server database ASP.NET成员资格数据库无法通过SQL Server实例工作 - ASP.NET membership database not working from SQL Server instance 从ASP.NET MVC应用程序连接到SQL Server - Connect to SQL Server from ASP.NET MVC application 显示ASP.NET MVC的GroupB的第一个实例和最后一个实例 - Showing First Instance and Last Instance of GroupBy ASP.NET MVC
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM