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?

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

  1. from windows start menu, choose microsoft sql server, , choose enterprise manager.
  2. open node server , expand node database want give users permissions for.
  3. right-click users node , choose new database user.
  4. 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

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

BizTalk Server 2013 Azure VM Log Shipping and HA for hosts

How to Share webservice object to all user