c# - Login failed for user. Trying to access a SQL Server Express database -


i'm trying access sql server express database, every time try, receive message:

login failed user.

here code:

sqlconnection cs = sqlconnection("data source=.\\sqlexpress;     initial catalog=mydatabase#4; integrated security=true"); cs.open(); messagebox.show(cs.state.tostring()); cs.close(); 

how can fix problem?

try write computer name instead of . after "data source". example:

data source=michael-pc\\sqlexpress;initial catalog=mydatabase#4;integrated security=true";


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -