c# - Connecting IIS to SQL Server 2014 on Windows Server 2012 -


i keep getting error

'cannot open database "mydb" requested login. login failed. login failed user "nt authority\network service"'

this connection string

sqlconnection _connection = new sqlconnection("data source='myserver\\se';initial catalog=mydb;integrated security=true;multipleactiveresultsets=true; trusted_connection=yes"); 

the same web form can connect locally sql server on windows 8.1.

why this?

in connection string, integrated security=true causing attempt login sql server using account iis runs with.

based on have described, 8.1 box has iis running account has permission access sql server.

you can add network service account sql server valid login, change account iis launches on server account has access sql server, or specify sql login in connection string instead of using integrated security.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -