c# - Connection to SQL server database in ASP -


i know question basic. don't know how should configure web.config information!

my sql server connected windows authentication. i'm using config:

<add key="dbserver" value="mssql" /> <add key="dbsource" value="localhost" /> <add key="dbname" value="testdb" /> <add key="loginname" value="karim-pc\karim" /> <add key="loginpwd" value="" /> 

but error:

{"this operation requires connection 'master' database. unable create connection 'master' database because original database connection has been opened , credentials have been removed connection string. supply unopened connection."}

exception: thrown: "login failed user 'karim-pc\karim'." (system.data.sqlclient.sqlexception) system.data.sqlclient.sqlexception thrown: "login failed user 'karim-pc\karim'."

add either <add key="trustedconnection" value="yes" /> or <add key="integratedsecurity" value="sspi" />to force windows authentication.

you can read more here.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -