I am using integrated security to connect to a sql database.
This is the connection string I am using:
Server=CRAIG_DAFF\\SQLEXPRESS;Initial Catalog=LairageScanning;MultipleActiveResultSets=true;Integrated Security=True;
While working in visual studio I have no problem connecting to the database. But when I install the application as service the application I get the following error:
Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot open database "LairageScanning" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\SYSTEM'.
Unsure as to why this is happening.
User contributions licensed under CC BY-SA 3.0