Cannot open user default database. Login failed. Login failed for user 'Server\Username'... again

I have been working for a few month on a project, when suddenly I can not access the local database I use for testing.

Here are some details:
Microsoft Visual Studio, C# application, The database is in the folder "App_Data," gets attached automatically, and is accessed using Windows authentication, and hence, no user accounts were created explicitely.

Connection string:
<add name="ASPNETDBConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>

I tried restoring the whole project from a backup (mdf file, web.config, ...), I still get the same error.
Other projects work fine... I don't even know where to look

Please help

0
EHS
12/11/2008 7:41:34 PM
asp.net.visual-studio-2005 7760 articles. 0 followers. Follow

36 Replies
1266 Views

Similar Articles

[PageSpeed] 40

Hi,

Add the following key just above httphandler section in web.config

<identity impersonate = "true" UserName = "Domainname\Username" Password = "Password" />


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
12/12/2008 5:24:32 AM

Thanks MAK for the tip,

However, this 'user' is not able to access the database, even when, in the 'Server Explorer' tab, I try to expand the 'ASPNETDB.MDF' tree (under Data Connections)

Any clue what happened? any turnaround?
At this point, I just want to be able to continue development

0
EHS
12/12/2008 10:38:58 AM

By username i mean ur windows username and password u use to login

 


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
12/12/2008 10:52:07 AM

Thanks for the quick reply

Yes, this is username\password that I used.
It also appears in the error message

0
EHS
12/12/2008 11:36:57 AM
Can u post the complete error and stack trace
MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
12/12/2008 11:56:46 AM

Sure, here it the stacktrace:

Cannot open user default database. Login failed.
Login failed for user 'Server\Username'.
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
   at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
   at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
   at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
   at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.SqlClient.SqlConnection.Open()
   at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
   at A_DataSetTableAdapters.L_TableAdapter.Get_ByDataID(Nullable`1 DataID)
   in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\A\74a5d8ee\ed703eaa\App_Code.3qlc3k1q.2.cs:line 11085
   at Search_.Fill_Data_DLL() in c:\Documents and Settings\EHS\My Documents\Visual Studio 2005\WebSites\A\Search.aspx.cs:line 139
  

 

0
EHS
12/12/2008 12:30:41 PM

in the identity key

instead of machinename\username add only username

for eg

ur Login = MAK

Pass = abc

then key will be

<identity impersonate ="true" userName ="MAK" password =" abc/>

If it  till gives the error let me know what it is


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
12/12/2008 1:01:50 PM

no, did not work
I got the same initial error message.

 Is there a tool to access the database, to add another username/password ?

0
EHS
12/12/2008 1:27:08 PM

Can u access the db from SQL server?? If u cannot what error message do u get?


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
12/12/2008 2:43:44 PM

No

Microsoft SQL Server Express gives me the same 2 lines error message as in the subject

0
EHS
12/12/2008 3:03:04 PM

I think ur connection is already open 

Within the VS  select Tools, Connect to Database, and right click on ASPNETDB.MDF and select"Close connection" try This


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
12/12/2008 3:19:30 PM

I got an "Add connection" window, which failed to let me connect, probably because of wrong parameters?

 "An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"

0
EHS
12/13/2008 12:38:26 AM

Just let me know

1. Where did u try to establish a connection with the dataabse Add connection" window

2. What has changed after which the dataabse failed to connect. I mean what was the change done after which u start getting errors


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
12/13/2008 5:35:04 AM

Right after I clicked on "Connect to Database" I got the "Add connection" window.

The thing that changed is that I added a table to the database, and worked on it for a few hours...
I tried "fixing" the error by removing the project (containing all files, aspx, images, web.config, App_Data folder, ...) and replacing it by a working back up. In vain.
 Which leads me to think that the problem is from somewhere else

0
EHS
12/13/2008 11:28:21 AM

Can you login to ur SQL Management Express using Windows Authentication. And access other databases?

Try giving rights to the ASPNET user. I think ur ASPNET user permissions have been removed. I think this will resolve the issue


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
12/13/2008 11:36:25 AM

I just added another database to that project... works very well. The "close connection" is not even dimmed (in the Server Explorer of Visual Studio)

Membership.GetUser() generates the same error (... Cannot open user default database ...) even when i tried that after deleting the connectionstring

0
EHS
12/13/2008 6:32:45 PM

I think its a permisssion issue

In SQL Management Express. Try attaching the database and then in permissions add ASPNet user. Also can u specify which user u r using to connect to the database


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
12/13/2008 6:39:02 PM

Please tell me how to add rights to the ASPNET user

please

0
EHS
12/13/2008 6:56:45 PM

Goto

C:\windows\microsoft.net\framework\v2.0.50727

Execute the file

aspnet_regsql.exe

A prompt will open and set the connection properties


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
12/13/2008 7:03:00 PM

Creation or change  of the SQL Server database failed

 

Setup failed.

Exception:
Unable to connect to SQL Server database.

----------------------------------------
Details of failure
----------------------------------------

System.Web.HttpException: Unable to connect to SQL Server database. ---> System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
   at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
   at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
   at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
   at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.SqlClient.SqlConnection.Open()
   at System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString)
   --- End of inner exception stack trace ---
   at System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString)
   at System.Web.Management.SqlServices.SetupApplicationServices(String server, String user, String password, Boolean trusted, String connectionString, String database, String dbFileName, SqlFeatures features, Boolean install)
   at System.Web.Management.SqlServices.Install(String database, SqlFeatures features, String connectionString)
   at System.Web.Management.ConfirmPanel.Execute()

 

0
EHS
12/14/2008 12:41:57 PM

Tell me one think what change did u so to ur machine after which these errors started coming


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
12/14/2008 1:22:41 PM

I can't remember changing anything, except adding a table to the database, and that was a few days earlier

I don't even have a Windows restore point available, to revert the whole system to how it was before

0
EHS
12/14/2008 10:11:28 PM

Hi,

I searched on net. so basically it seems that the error is SQL Server authentication error. Either ur SQL server windows Authentication is not working for u in ur machine. Try uninstalling and re installing the SQL server management studio.


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
12/15/2008 4:52:04 AM

Ok I will do that, thank you for your support.

You wrote: "either... (or...)"
did you want to say something else too?

0
EHS
12/15/2008 10:54:00 AM

since u r not able to logon to the SQl server mgmt studio. U need to reinstall it. if u have login for some user then try login using SQL server authentication. This issue happened to me when i installed SQL server 2005 in my system which already had SQL server 2000.

 


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
12/15/2008 11:04:45 AM

A last try

can u paste the username and the machine name specifed in the error. If its not the username which u use to login please paste it


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
12/15/2008 11:33:13 AM

Cannot open user default database. Login failed.
Login failed for user 'TEKILA\Minsk'.

PS: I am having troubles Installing the SQL Server Express edition I found online, so this might take a while...

0
EHS
12/15/2008 2:14:25 PM

EHS:

Cannot open user default database. Login failed.
Login failed for user 'TEKILA\Minsk'.

PS: I am having troubles Installing the SQL Server Express edition I found online, so this might take a while...

Hi,

If we deploy website on the IIS, this website is running under IIS account (in your case, it looks like 'Server\Username'), which does not have permission to log in your Sql Server by default.

To use Windows authentication correctly, we need to add this account to new login and set SQL Server to either Integrated authentication or Mixed-Mode authentication.

For more information, see http://www.asp.net/learn/whitepapers/aspnet-and-iis6/ (Section: Supporting integrated authentication with SQL Server). 
 
We also can use UserID and Password to connect database. The connection string should look like "Server=YourServerAddress;Database=YourDataBase;Uid=YourUsername;Pwd=YourPassword;"


For more information, see http://www.connectionstrings.com/?carrier=sqlserver2005
 

I look forward to hearing from you.


Thomas Sun
Microsoft Online Community Support

Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
0
Thomas
12/16/2008 4:57:22 AM

I failed again.

I removed the SQL Server 2005, and installed the SQL Server 2005 Express Edition.
I am not sure if the "Compact" version that comes with the Visual Studio installed successfully or not; I got mixed feedback.
Now I don't have anymore the "Enterprise Manager" and "SQL server management studio" neither.

I got the same errors: "Login failed for user..."
and "When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections" when trying to edit some accounts.
BTW, no database was showing in that wizard, except for the [default] one, when I got that error, which added to my confusion: Where should I add permissions to the ASPNET user?

Note: I dont NOT have IIS, since I use XP Home edition, Visual Studio comes with its own built-in webserver (called Cassini or ASP.NET Development Server, i don't know)
I am also using a limited version of the SQL Server.
I am not sure how this affect the standard settings of a web application (creating a virtual directory on IIS, creating users to access the databse, ...)

Any comment/idea?

0
EHS
12/17/2008 2:46:52 PM

Install the sql server management studio express


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
12/17/2008 3:09:37 PM

Although it didn't solve my particular problem, I now have a new toy :)

0
EHS
12/17/2008 5:14:30 PM

Use it and try attaching ur database to it

 


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
12/17/2008 5:21:38 PM

Almost there:
I was able to attach the database, access it and add a dummy table to it :)

I am now trying to do the same from the application:

  • I changed the authentication mode to SQL Server and Windows authentication
  • Created a user
  • changed the connection string: replaced "Integrated Security=True" by "User ID=greeting;Password=keyfak"

I got this error: "Failed to generate a user instance of SQL Server. Only an integrated connection can generate a user instance. The connection will be closed."

According to MSDN, "Integrated Security should be set to true. To connect to a user instance, Windows Authentication is required; SQL Server logins are not supported"

I will keep you posted, as soon as i find something

 

0
EHS
12/17/2008 8:28:04 PM

I forgot the add the link to the MSDN article, here is it:

Working with User Instances 
http://msdn.microsoft.com/en-us/library/ms254504(VS.80).aspx

0
EHS
12/17/2008 8:44:43 PM

A copy of the database was created in
C:\Documents and Settings\username\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS

Deleting the content of that folder solved my problem Smile

0
EHS
12/17/2008 9:48:20 PM

If u need to use integrated security = true

see my post http://forums.asp.net/p/1358288/2795920.aspx#2795920 It will resolve ur issue


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
12/18/2008 4:35:18 AM
Reply:

Similar Artilces:

Cannot open user default database. Login failed. Login failed for user 'DOMAIN\User'. (.Net SqlClient Data Provider)
Hi when i try and open a database in sql server management studio i get the error "Cannot open user default database. Login failed. Login failed for user 'DOMAIN\User'. (.Net SqlClient Data Provider)", what can i do to rectify this, i have googled around and still havent found no answers. Which authentication mode is your Sql Server configured - MixedMode, Windows Authentication or Sql Server Authentication? Please refer to http://msdn2.microsoft.com/en-us/library/ms366351.aspx and http://blogs.msdn.com/sql_protocols/archive/2006/02/21/536201.aspx    Ple...

Cannot open database requested in login 'database'. Login fails. Login failed for user 'webuser'.
I am getting the following error from a previously working asp.net application Cannot open database requested in login 'fieldservice'. Login fails. Login failed for user 'webuser'. I checked the connection string dim myconn as sqlconnection=new sqlconnection("server=milkman;uid=webuser;pwd=xxx;database=fieldservice"), and it is the same as another application that is still working. I am able to use query anaylizer and connect to the db and run the query that is attempting with this information so I am lost. Anyone out there got any ideas? Thanks, Justin T...

Cannot open user default database. Login failed. Login failed for user 'KONTORET\ASPNET'.
Hi all I get the above error when i try to  open http://localhost/Beerhouse. This is what i have done:Opened the TheBeerHouse.sln in WWD and copyed the website to my http://localhost/BeerhouseIIS and SQL Experss is running.I am logged in as Administrator. It works fine when i run F5 in the orginal solution, but i want to publish it to my localhost. TIA   First, try detaching the database in Visual Studio (by right clicking on it). If that doesn't help, try deleting the database log file (it will be re-created automatically). Jos Jos Branders: First, try detaching ...

Cannot open database "DataBase" requested by the login. The login failed.Login failed for user 'User\ASPNET'.
hi all, i am having my asp.net project and database is in same system. in web.config i diclaire my connection string as <add name="MyWebConString" connectionString="Data Source=AIPL069\SQLEXPRESS;Initial Catalog=MyWeb;Integrated Security=True" providerName="System.Data.SqlClient"/> when i login application i got an error error is Server Error in '/MyWeb' Application. Cannot open database "MyWeb" requested by the login. The login failed.Login failed for user 'AIPL069\ASPNET'. Description: An unhandled exception...

Cannot open database requested in login 'sql'. Login fails. Login failed for user '\ASPNET'.
I am using the MSDE to connect to my ASP.NET application. I get this error after clicking the login button of my login page. Anyone know why this would happen? Thanks for any help, Cannot open database requested in login 'DataSQL'. Login fails. Login failed for user 'server\ASPNET'.Thank youJackxxx I thought i shold add that when this was on the development PC the database was named DataSQL. On the new PC it is DataSQL2, so I'm not sure why the error shows DataSQL. Thanks,Thank youJackxxx What are the contents of your connection string? Where is it stored? TerriTerri MortonE...

Error: Cannot open database requested in login 'projectAllocations'. Login fails. Login failed for user 'sa'.
Hi, Im getting this error when attempting to retrieve data from an sql database. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Cannot open database requested in login 'projectAllocations'. Login fails. Login failed for user 'sa'. Source Error: Line 13: objConn = New SqlConnection( "Server=LAB303-066\NETSDK; Database=projectAllocations; User ID=sa;Password=mypas...

Cannot open database requested in login 'dbName'. Login fails. Login failed for user 'machineName\ASPNET'
Been looking through the forums for a solution to this problem.I already tried granting access through statements such as:exec sp_grantloginaccess N1'machineName\ASPNET'But they don't seem to work.. i vaguely remember seeing somewhere a DOS command line statement that grants access to the ASPNET_WP and that fixed my problem before on another computer.. but this is a new computer and i forgot to write down the command.Can anyone help explain and propose a solution to my problem. Many thanxs. osql -E -S InstanceName -C -Q "sp_grantlogin 'computer\ASPNET'" osql -E -S InstanceName -d database ...

Cannot open database requested in login 'Portal'. Login fails. Login failed for user 'JAY\ASPNET'.
Guys, I've been beating my head with this. Please help. Let me see if I can explain. I'm running the IBuySpy Portal self install utility. It used to fail and say could not find SQL server, but after someone posted that you need to enable TCP/IP it has gotten further. Now, it will bring up a dos prompt and it looks like it tries to create the database. It errors our saying Could not add aspnet user to database: Cannot open database requested in login 'Portal'. Login fails. Login failed for user 'JAY\hawkswim32'. I looked at the output when it was installing the datab...

Cannot open database requested in login 'AstraTrain'. Login fails. Login failed for user 'NT AUTHORITY\NETWORK SERVICE'. "
Hi I just made some changes to my Website.... I configured my website to run under SQL server authentication....so i created an user under SQL server named it "sqltestapp".Then I was trying to connect to the database using this user account. So I made theconnection string as <add name="AstraTrainConnectionString" connectionString="Data Source=ITAPPDEV;Initial Catalog=AstraTrain;User id=sqltestapp; password= sqltestapp;Integrated Security=false"providerName="System.Data.SqlClient" />Now I am using  SQL authentication to connect to the ...

Error: Cannot open database requested in login 'dbname'. Login fails. Login failed for user 'NTAUTHORTY\NETWORKSERVICE
HI all when I was trying to host a website I got the following error Cannot open database requested in login 'dbname'. Login fails. Login failed for user 'NTAUTHORTY\NETWORKSERVICE Previously I got an error Login failed for user 'NTAUTHORTY\NETWORKSERVICE so I ran sp_grantlogin 'NTAUTHORITY\NETWORKSERVICE' in query analyzer.When I wet through the page once again I encountred the error  Cannot open database requested in login 'dbname'. Login fails. Login failed for user 'NTAUTHORTY\NETWORKSERVICEpls help me!!!Thanks in advance.... Ravi Chilakamart...

Cannot open database requested in login "database". Login fails. Login failed for user 'TAMILARASI\ASPNET'
Hi, I have a big problem with accessing asp.net application with sql server express database in IIS. Normally my application working fine but some time i got the error like "Cannot open database requested in login "database". Login fails. Login failed for user 'TAMILARASI\ASPNET'. " i already gave permission for ASPNET account by calling stored procedure "exec sp_grantlogin 'TAMILARASI\ASPNET'  my connection string is<remove name="TranslationConnectionString"/> <add name="TranslationConnectionString" connectionStri...

Cannot Open Database "XXXX" requested by login. The login failed. Login failed for user 'xxx'
hi,  so i have a new box and I'm trying to get my websites and SQL Server 2005 Standard Edition working on it, but the pages give me the following error when I try to load them: "Cannot Open Database "XXXX" requested by login.  The login failed.  Login failed for user 'xxx'" Everything seems exactly the same settings and user-wise from my old box to my new one, but nevertheless everything I've tried gives me the same error. I've tried creating new users in SQL Server and giving them appropriate permissions to my database.  I've even tried just using the buil...

Cannot open database "Noddy" requested by the login. The login failed.Login failed for user 'ANOTHER\asmith'.
Hi   Using Visual Studio 2005, SQL Server 2005.   I am trying to implement error trapping in my first asp.net application.   I want to error trap database being offline so I took the database offline.   Therefore when I tried to login into my application I was expecting to get an error such as   Exception Details: System.Data.SqlClient.SqlException: Cannot open database "CRM" requested by the login. The login failed.Login failed for user 'CSLSYSTEMS\ywhittaker'.     Then in the Web.config file, I included the following code    &nb...

Cannot open database "Test" requested by the login. The login failed. Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
Hi, I'm having some problems with my login.I've set impersonation to true in web.configI've granted login access to the databaseI've granted dbaccess to the databaseBut I still get the error when I try to login to my website.  So I can't help but think I didn't configure something properly with my website defined users needing to access the system. Any ideas? Here's the error: Cannot open database "Test" requested by the login. The login failed.Login failed for user 'NT AUTHORITY\NETWORK SERVICE'. Thanks for any help. It's all in th...

Web resources about - Cannot open user default database. Login failed. Login failed for user 'Server\Username'... again - asp.net.visual-studio-2005

Resources last updated: 12/12/2015 7:44:43 PM