Connecting to database
{"login failed user 'domainname\\mycomputername$'."} system.data.common.dbexception {system.data.sqlclient.sqlexception}
have modified connection properties use sql user name , password. recompiled 1000 times. why hell still uses computer name there when using integrated security?
have modified connection properties use sql user name , password. recompiled 1000 times. why hell still uses computer name there when using integrated security?
hi
when create connection string application, not include user name , password. instead, set connection string's integrated security attribute sspi.
the following example shows connection string includes appropriate attributes:
data source=myserver;initial catalog=northwind;integrated security=sspi
to configure sql server integrated security
- from windows start menu, choose microsoft sql server, , choose enterprise manager.
- open node server , expand node database want give users permissions for.
- right-click users node , choose new database user.
- in database user properties dialog box, enter domain
\
username in login name box, , click ok.
have nice day!
cookie luo[msft]
msdn community support | feedback us
get or request code sample microsoft
please remember mark replies answers if , unmark them if provide no help.
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment