4
Answers

SQL Server Integrated Security ConnectionString not using my domain credentials

Photo of Mark Conway

Mark Conway

14y
4.2k
1
Hi there,

I have the following connection string:
 <connectionStrings>
<add name="DBConnectionString" connectionString="Server=ASEGH-SQL-T09\BackOffice;Integrated Security=SSPI;database=AsosBackOffice;" providerName="System.Data.SqlClient"/>
</connectionStrings>



However when my ASP.NET page tries to connect to the database it gets a LogIn failure because it is not using the user account that I have logged into windows with.

This is the stack trace of the error:
 .......
.......
BusinessObjects.ProjException: ASP.usercontrols_receipt_ctlreceiptlist_ascx.RenderMe ---> BusinessObjects.ProjException: ASP.usercontrols_receipt_ctlreceiptlist_ascx.PopulatePageData ---> BusinessObjects.ProjException: ASP.usercontrols_receipt_ctlreceiptlist_ascx.dgReceipts_ItemDataBound ---> System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: Login failed for user 'ASSEENONSCREEN\WS-09G-05QFF$'. (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.Data.SqlClient.SqlException: Login failed for user 'ASSEENONSCREEN\WS-09G-05QFF$'.
   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, 
.....
.....


It should attempt to log in with ASSEENONSCREEN\MarkC, this is the user I am logged on to windows with and hosting my IIS website with. I guess I dont fully understand how SQL Server Integrated Security works :S

Please help me on this one! 

Thanks in advance,

Mark.

Answers (4)

0
Photo of Mark Conway
NA 10 11.5k 14y

Just confirmed this is the c onnection string that the server is using: <add connectionString="Server=ASEGH-SQL-T09\BackOffice;Integrated Security=SSPI;database=AsosBackOffice;" name="DBConnectionString"/>
I have good and bad news:
The good news is it just started working
The bad news is, i have no idea why. I didn't make any significant changes so i'm assuming that something has changed in my domain's active directory and allowed it to correctly look up my current user account.
0
Photo of Suthish Nair
NA 31.7k 4.6m 14y

can you recheck your connection string: http://www.connectionstrings.com/sql-server-2008

Another way to find the connection string. Drag and drop an dropdownlist on page.

Try bind the control with table data. You can find the actual connection string in web.config.
0
Photo of Mark Conway
NA 10 11.5k 14y
Thanks for the prompt reply. However this article does not explain why it is using an unexpected windows identity. If it uses the correct user (ASSEENONSCREEN\MarkC) then it will log on fine.
0
Photo of Subhendu De
NA 3.7k 292.3k 14y