My favourite way to clean up database tables is with a little stored procedures that runs from an async database command. It is a bit old fashioned but LinqToSql does not have any built-in async support. I want avoid that the clean-up tasks uses processing time of my application.
To create the async command I need the current connection string and add the ASYNC=True value. Easy, I thought. I take the DataContext.Connection.ConnectionString, use it to instantiate a ConnectionStringBuilder and set the Async property. This worked fine as long as I was running with SSI. When I changed to SQL server login I got this error: Error: 18456, Severity: 14, State: 8.
This means that the password is incorrect. That proved to be absolutely correct. The ConnectionString property does not return the password and this is not mentioned in the MSDN.