开发者

login failed error for my database on localnetwork

开发者 https://www.devze.com 2023-03-05 03:22 出处:网络
I created my databa开发者_开发百科se on the server using code. Now no client on the local network can login to my database. This error occurs:

I created my databa开发者_开发百科se on the server using code. Now no client on the local network can login to my database. This error occurs:

:"cannot open database "test" requested by the login.
the login failed for user "farzane".

Here is the connection string for my database:

ConnectionString=@"Data Source=SERVER\SQLEXPRESS;Initial Catalog=test;
   Integrated security=SSPI;Persist Security Info=False"; 

How can I fix this problem?

I have about 30 clients on my network, and I don't want to create a login for every one. Is it possible to assign permissions and read/write access for all of them using code? thanks.


If your clients have existing accounts on your LAN, you can right-click on the database, select Properties and then the Permissions section to assign users and groups the permissions you want them to have on your database. Alternatively, you can go to Security/Logins and right-click the groups or users you want to assign permissions to, select Properties, then choose the User Mappings section to grant permissions on specific databases.

Because you can do it with the GUI, you must be able to do it in code, but that I am afraid is not my area of expertise.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号