Connect with SQL Server 2008 Express using Winforms (C#) -
i creating database coding in winforms (c#) , run script creating tables.
in short create database using winforms (c#) in sql server express.
but when run application error :
cannot open database '' requested login. login failed. login failed user 'ketan\admin'.
my connection string:
server=.\sqlexpress;integrated security=true;database=mydatabasename;user id=myusername;password=mypassword;
any appreciated.
if have both
integrated security=true;
and
user id=myusername;password=mypassword;
in connection string, integrated security
wins , specific user , password ignored, , connection attempted current windows credentials (ketan\admin
) , doesn't seem work
so change connection string to:
server=.\sqlexpress;database=mydatabasename;user id=myusername;password=mypassword;
now, specific user , password used connect sql server, , if correct, should able connect fine
Comments
Post a Comment