Q:

can not open database on localnetworks

I write a win app,and i create my database on the server by codes.now every client on local network can't login to my database and this error occured
:"cannot open database "test" requested by the login.the login failed for user "farzane".

the connectionstring for to make my database is:
ConnectionString=@"Data Source=SERVER\SQLEXPRESS;Initial Catalog=master;Integrated security=SSPI;Persist Security Info=False";

and it's my connection string for open my database:
ConnectionString=@"Data Source=SERVER\SQLEXPRESS;Initial Catalog=test;Integrated security=SSPI;Persist Security Info=False"; 

how can give permission for logining to my database to any client with codes???
thanks in advance for any help.

A:

I would check two things here:

Ensure that your SQL Express install allows remote connections. (Simple to check using SQL Server Studio Manager).
You are using trusted authentication in your connection string.  You have to explicitly give users on your domain access on the database.  You will have to this in SQL Server. 

