I have a local windows managed service that is trying to connect to a local instance of SQLExpress and am hitting a brick wall wrt the connectionstring / the authentication that the local service needs to use.
Here is the config for the managed service
<add key="..." value="Data Source=<machineName>\SQLEXPRESS;Persist Security Info=True; Integrated Security=True" />
The interesting thing is that this works but only provides access to the master db. It does not give any access to the actual db that the service needs. I have tried all sorts of possibilities in SQL Management Studio re giving access / security / user but to no avail.
I have tried using initial catalog but get a security exception
<add key="..." value="Data Source=<machineName>\SQLEXPRESS;Persist Security Info=True;inital catalog=<dbName>; Integrated Security=True" />
I am also working on the assumption that
a. The Log-on used by the managed service is a red herring and this is indeed a SQLServer issue.
b. If the SQLServer were not local then the managed service would need AD credentials.
“Initial Catalog=MyDatabase;” (without quotes) to your connection string.
The last two steps can be accomplished from SQL Server Management Studio.
Happy coding