首页 新闻 会员 周边 捐助

MVC运行问题 大神求解!

0
悬赏园豆:5 [已关闭问题] 关闭于 2014-09-28 12:30

{"基础提供程序在 Open 上失败。"}

问题补充:

stem.Data.SqlClient.SqlException: 用户 'sa' 登录失败。

源错误: 

执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。


堆栈跟踪: 

[SqlException (0x80131904): 用户 'sa' 登录失败。] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5066282 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +183 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +239 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +195 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +232 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +33 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +524 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +479 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.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +81 [EntityException: 基础提供程序在 Open 上失败。] System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +273 System.Data.EntityClient.EntityConnection.Open() +184 System.Data.Objects.ObjectContext.EnsureConnection() +142 System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) +90 System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() +96 System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +315 System.Linq.Enumerable.ToList(IEnumerable`1 source) +58 MovieApp.Controllers.HomeController.Index() in D:\dotNetProject\MovieApp\MovieApp\Controllers\HomeController.cs:18 lambda_method(Closure , ControllerBase , Object[] ) +62 System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +51 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +409 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +52 System.Web.Mvc.<>c__DisplayClassd.<InvokeActionMethodWithFilters>b__a() +127 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +436 System.Web.Mvc.<>c__DisplayClassf.<InvokeActionMethodWithFilters>b__c() +61

但是事实上我的数据库可以连接得上

IT_小子的主页 IT_小子 | 初学一级 | 园豆:17
提问于:2014-09-19 13:47
< >
分享
所有回答(3)
0

等于没有问,说清楚哈

Halower | 园豆:1723 (小虾三级) | 2014-09-19 13:54
0

数据库没连上

骑着蜗牛耍流氓 | 园豆:135 (初学一级) | 2014-09-19 16:01

 <add name="ApplicationServices" connectionString="server=.;database=tempdb; user id=sa;pwd=111;"/> 我其他的程序都可以连接的上这个我不知道为什么?(原来他本来的连接是这个<add name="ApplicationServices" connectionString="data source=.;Integrated Security=SSPI;database=tempdb;User Instance=true" providerName="System.Data.SqlClient" />上面是我改的)

支持(0) 反对(0) IT_小子 | 园豆:17 (初学一级) | 2014-09-19 16:32
0

数据库连接失败,检查下配置

大楚打码人 | 园豆:4313 (老鸟四级) | 2014-09-19 16:09

谢了!但我其他的项目都连接得上

支持(0) 反对(0) IT_小子 | 园豆:17 (初学一级) | 2014-09-19 16:32

@IT_小子: 数据库没连上

支持(0) 反对(0) Halower | 园豆:1723 (小虾三级) | 2014-09-19 16:37
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册