I get that error.
I'm sure you see this question alot, but i'm dumfounded by it. Problem is that i've taken the code directly off the live website, yes i've changed the connection string...
Private _connStr As String = "Data Source=localhost\SQLEXPRESS;Initial Catalog=EFM;User ID=*****;password=******;Trusted_Connection=true"
and am using the database that was originally worked on...
Only thing that has changed is my new computer... had to reload everything... new VWD, new sql express, new sql servermanagement studio express... all semmingly working fine... ie i can see the database and edit it, i just cant connect to it through the localhost to test the program.
Any Ideas? why does this error come up... how can i fix it?
Thanks in advance
Cannot open database "EFM" requested by the login. The login failed.
Login failed for user 'GERTIE\IBM USER'.
Description:Anunhandled exception occurred during the execution of the current webrequest. Please review the stack trace for more information about theerror and where it originated in the code. Exception Details:System.Data.SqlClient.SqlException: Cannot open database "EFM" requested by the login. The login failed.
Login failed for user 'GERTIE\IBM USER'.
Source Error:
Line 19: MyBase.New()
Line 20: myConn = New SqlConnection(_connStr)
Line 21: myConn.Open()
Line 22: End Sub
Line 23:
Source File: C:\Documents and Settings\IBM USER\Desktop\Entertainment\wwwroot\App_Code\cDB.vb Line: 21
Stack Trace:
[SqlException (0x80131904): Cannot open database "EFM" requested by the login. The login failed.
Login failed for user 'GERTIE\IBM USER'.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +171
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +199
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2300
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +34
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +606
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +193
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +501
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +429
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +70
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +510
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +85
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +89
System.Data.SqlClient.SqlConnection.Open() +160
Datalayer.cDB..ctor() in C:\Documents and Settings\IBM USER\Desktop\Entertainment\wwwroot\App_Code\cDB.vb:21
_Default.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\IBM USER\Desktop\Entertainment\wwwroot\Default.aspx.vb:29
System.Web.UI.Control.OnLoad(EventArgs e) +80
System.Web.UI.Control.LoadRecursive() +49
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3745
Did you recreate the user in SQL? Is the system still named GERTIE? The user still exists in the new system?
Jeff
|||the user exists in the database... no change from the proviously working version...
the system name should be irrelevant because of using localhost in the string? or is that not correct.
i don't understand what you mean by the user still exists in the new system. maybe this line of thought has something to do with it...
|||
been searching, and have never seen this issue solved...
i'm starting to get worried...
|||
Some one might be interested to know that i solved this all by myself in the end. It would appear to have somehing to do with IIS not being installed... each time this happens to someone it seems to be moving the systems accross onto a new pc... well it happens very often... I installed IIS, rebooted the pc and then unattached and then reattached the database
worked a charm!!!
Hope this helps someone some where... Oh an i want some points for this contribution!!!;)
|||
Just to be clear, IIS was installed. Otherwise you never would have received an ASP.NET error, since the file could never be processed.
Jeff
sql
No comments:
Post a Comment