0

我收到错误

SqlException (0x80131904): 用户 'raam030' 登录失败

对于我的 ASP.NET MVC4 应用程序。使用本地 SQL Server 在我的开发机器上工作正常,但是当我将它部署到网络托管时,这就是我得到的。我搜索了相同的问题,有很多但到目前为止没有一个对我有帮助。

我有下面的堆栈跟踪,我三重检查并确保我的连接字符串是正确的并且 SQL Server 身份验证是正确的。虽然我的托管服务连接字符串不需要密码信息,但我尝试了没有和使用硬编码密码和用户名的变体。

<connectionStrings>
   <add name="RMSDelta" 
        connectionString="Data Source=mssql2.openhost.net.nz;Integrated Security=False;User ID=myusername; Password=mypassword;Connect Timeout=15;Encrypt=False;Network Library=dbmssocn;Packet Size=4096" 
        providerName="System.Data.SqlClient" />
</connectionStrings>

我正在使用代码优先方法。我的数据库名称与我用作连接字符串名称的名称相同,用于在我的上下文类中作为连接字符串传递的名称相同。确保提供者名称正确。除了数据访问部分(和需要数据的页面)之外,其他所有页面都可以在我的应用程序中正常工作。我不确定还能从这个堆栈跟踪中得到什么?

请帮我。

堆栈跟踪:

[SqlException (0x80131904): 用户 'raam030' 登录失败。]
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +1316
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +108
System.Data.ProviderBase .DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
System.Data.SqlClient.SqlConnection.Open() +125
System.Data.SqlClient.SqlProviderServices.UsingConnection(SqlConnection sqlConnection, Action 1 act) +349 System.Data.SqlClient .SqlProviderServices.GetDbProviderManifestToken(DbConnection 连接) +265 System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection 连接) +34 1 act) +85
System.Data.SqlClient.SqlProviderServices.UsingMasterConnection(SqlConnection sqlConnection, Action


[ProviderIncompatibleException:提供程序未返回 ProviderManifestToken 字符串。]
System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection 连接)+163
System.Data.Entity.ModelConfiguration.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices,DbConnection 连接)+40

[ProviderIncompatibleException:从数据库获取提供者信息时出错。这可能是由 Entity Framework 使用不正确的连接字符串引起的。检查内部异常以获取详细信息并确保连接字符串正确。]

System.Data.Entity.ModelConfiguration.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices,DbConnection 连接)+163
System.Data.Entity.ModelConfiguration.Utilities.DbConnectionExtensions.GetProviderInfo(DbConnection 连接,DbProviderManifest& providerManifest)+39
System.Data.Entity。 DbModelBuilder.Build(DbConnection providerConnection) +46
System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext) +62
System.Data.Entity.Internal.RetryLazy 1.Initialize() +56 System.Data.Entity.Internal。 Linq.InternalSet 1.System.Collections.Generic.IEnumerable.GetEnumerator() +40 System.Linq.WhereSelectEnumerableIterator2.GetValue(TInput input) +117
System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +453
System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +18
System.Data.Entity.Internal.Linq.InternalSet

1.GetEnumerator() +15
System.Data.Entity.Infrastructure.DbQuery

2.MoveNext() +63
ASP._Page_Views_Default_Qualifications_cshtml.Execute() in d:\vhosts\rameshsivaraman.me\httpdocs\Views\Default\Qualifications.cshtml:45
System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +209
System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +104
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +78
System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +234
System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +107
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +291
System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +23
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func
1 续) +264
System.Web.Mvc.<>c_ DisplayClass1c.b _19() +20
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList 1.End() +50 System.Web.Mvc.Async .AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +26 System.Web.Mvc.<>c_ DisplayClass1d.b _18(IAsyncResult asyncResult) +14 System.Web.Mvc.Async.<>c_ DisplayClass4.b _3(IAsyncResult ar) +25 System.Web.Mvc.Async.WrappedAsyncResult 1.End() +55 System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +281 filters, ActionResult actionResult) +176
System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +71
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +128
System.Web.Mvc.Async.WrappedAsyncResult




1.End() +55
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +41
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +25
System.Web.Mvc.Async.WrappedAsyncResult


System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
System.Web.Mvc.<>c_ DisplayClass8.b _3(IAsyncResult asyncResult) +28
System.Web.Mvc。 Async.<>c_ DisplayClass4.b _3(IAsyncResult ar) +25
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +30
System.Web .Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult 结果) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9041917
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously ) +184

4

1 回答 1

0

有时事情是多么愚蠢......似乎我的托管公司不知何故需要一个超过 6 个字符的密码才能验证到 sql server,我之前使用的是 4 个字符的密码,当我使用更长的密码时它确实有效,但是托管服务提供商 Plesk面板在我设置帐户时接受4个字符的密码!!!。我不得不花半天时间摆弄这件事,我现在要发一封电子邮件,问他们为什么不对此表现出任何谨慎...谢谢朋友..

于 2013-09-01T13:53:17.123 回答