This project is read-only.
1
Vote

DB Error... Cannot open database...

description

This is my first look at this sample and from what I have read about it its perfect for teh base of my new WEB project.
 
BUT
 
I am getting the following error...
Cannot open database "TheBeerHouseVB" requested by the login. The login failed.
Login failed for user 'AnnePerry-PC\Phill'.
 
I changed the web.config file to reflect the following... <add name="LocalSqlServer" connectionString="Data Source=~/App_Data/ASPNETDB.MDF;Initial Catalog=TheBeerHouseVB;Integrated Security=True;" providerName="System.Data.SqlClient"/>
 
I am not sure what I have missed? I have put the DB in the App_Data folder as usual... I have connected to it in the Server Explorer. I even went outside to my SWL Manager to check that it could see it too. I tried to open the DB using the ASP.NET Configuration tool and it failed to connect to the DB also. That is a first for me!
 
I am greateful for any assistance I can get... thanks
Phill
 
Stack Trace...
 
[SqlException (0x80131904): Cannot open database "TheBeerHouseVB" requested by the login. The login failed.
Login failed for user 'AnnePerry-PC\Phill'.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4849719
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189
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) +31
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
System.Data.SqlClient.SqlConnection.Open() +122
System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +47
 
[EntityException: The underlying provider failed on Open.]
System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +168
System.Data.EntityClient.EntityConnection.Open() +96
System.Data.Objects.ObjectContext.EnsureConnection() +81
System.Data.Objects.ObjectQuery1.GetResults(Nullable1 forMergeOption) +46
System.Data.Objects.ObjectQuery1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() +44
System.Linq.Enumerable.FirstOrDefault(IEnumerable
1 source) +203
System.Data.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__1(IEnumerable1 sequence) +40
System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle(IEnumerable
1 query, Expression queryRoot) +59
System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute(Expression expression) +109
System.Linq.Queryable.FirstOrDefault(IQueryable`1 source) +269
BLL.SiteMapRepository.GetSiteMapInfoByURL(String URL) in C:\Application Projects\BeerHouse\C\TBHBLL\Navigation\SiteMapRepository.cs:137
TheBeerHouse.URLRewrite.Rewrite(HttpApplication app) in C:\Application Projects\BeerHouse\C\TBHBLL\Modules\URLRewrite.cs:56
TheBeerHouse.URLRewrite.BeginRequest(Object sender, EventArgs e) in C:\Application Projects\BeerHouse\C\TBHBLL\Modules\URLRewrite.cs:39
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

comments

Mokshad wrote Jun 9, 2010 at 12:12 PM

hi

wrote Feb 22, 2013 at 12:12 AM