Hi,
I am using VS2003 with SQLExpress on my local machine. I am trying to configure an app to connect to a loca sql express database. The following is
the connection string that I am using and the error message that I am receiving.
Any ideas what the problem is?
<add key="connectionString" value="Server=IKITSCH\SQLEXPRESS;database=Test1;trusted_connection=true" />
Cannot open database "Test1" requested by the login. The login failed. Login failed for user 'IKITSCH\ASPNET'.
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 "Test1" requested by the login. The login failed. Login failed for user 'IKITSCH\ASPNET'.
Source Error:
Line 1600: {
Line 1601: SqlConnection conSql = new SqlConnection(ConnectionString);
Line 1602: conSql.Open();
Line 1603: return conSql;
Line 1604: }
Source File: c:\inetpub\wwwroot\testsite\classes\config.cs Line: 1602
Stack Trace:
[SqlException: Cannot open database "Test1" requested by the login. The login failed.
Login failed for user 'IKITSCH\ASPNET'.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +472
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
eStreamBG.Dating.Classes.DB.Open() in c:\inetpub\wwwroot\testsite\classes\config.cs:1602
eStreamBG.Dating.Classes.DBSettings.Get(String Key) in c:\inetpub\wwwroot\TestSite\Classes\DBSettings.cs:125
eStreamBG.Dating.Classes.DBSettings.Get(String Key, String Default) in c:\inetpub\wwwroot\TestSite\Classes\DBSettings.cs:75
eStreamBG.Dating.Classes.Misc.get_SiteEmail() in c:\inetpub\wwwroot\testsite\classes\config.cs:1719
eStreamBG.Dating.Classes.EmailQueueItem.Create(String to, String subject, String body) in c:\inetpub\wwwroot\TestSite\Classes\Email.cs:224
eStreamBG.Dating.Classes.ExceptionLogger.Log(String source, Exception ex) in c:\inetpub\wwwroot\TestSite\Classes\Exceptions.cs:122
Many Thanks!
------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
Hi
You are using integrated security for authentication to the SQL Server database.
ASP.Net runs with the identity of the ASPNET user account by default and this user account has limited rights.
Try to avoid integrated security and specify the user name and password for the SQL Connection String instead.
And make sure you DB name isTest1 not test1
You can download Management Studio Express from here:
http://msdn.microsoft.com/vstudio/express/sql/download/|||
Hi,
Many Thanks!
|||Hello,
I am also experiencing the same problem as 'chemystery', and I too have used integrated security in my connection string for authentication to the SQL Server.
I have contacted the DB and server administrators to find out if they can give me the username and password so that I can include it in my connectionstring but they have refused as they say it breaches their security protocols.
Is there another way around this that will allow integrated security and allow access to the DB?
Thanks in advance!
Walkthrough: Encrypting Configuration Information Using Protected Configuration
Or?ask the database host to add your Windows account?to?SQL?logins?and?give?it?proper?permissions,?so?that?you?can?the?same?Windows?Identity?when?opening?connection?with?Integrated?Security.?To?ensure?to?use?your?account?to?open?conneciton?for?each?web request,?you?can?use?impersonation?with?credentital, please refer to: identity Element
No comments:
Post a Comment