locked
Cannot Open Database Requested by Login.The Login Faield. RRS feed

  • Question

  • Hi.

    I Published a windows form application in visual studio 2010 and microsoft sql server 2008 r2.

    when I use server locally or use my notebook to run application everything is OK. But when i use other client Computers to run application there is an error : "Cannot open database "EyeClinic" Requested by login. Login failed for user "Nur-Pc\Nurc".

    The Network is workgroup and my connection string is: connectionString="Data Source=192.168.1.100;Initial Catalog=EyeClinic;User ID=eyeclinic;Password=MyPassword".

    Please Help me.......!!!!!!!!!!!!!!!!!!!!!

    Thank you so much

    Thursday, November 7, 2013 6:57 AM

Answers

  • any one can help me ??????????????????????????
    • Marked as answer by Saeed Sohraby Monday, July 11, 2016 8:40 AM
    Monday, November 11, 2013 3:56 PM
  • Hi All.

    Thank's for your answers.

    I've found my problem's answer.

    There was an error in my connection string and when I corrected that my problem was solved.

    Thank you too much again.

    Have a nice day.

    • Marked as answer by Saeed Sohraby Wednesday, November 27, 2013 11:34 AM
    Wednesday, November 27, 2013 11:33 AM

All replies

  • Hi Saeed,

    Did you attach a database file to the database server? What is your actual database name? Is it "EyeClinic" or a string path of the database name?

    Please check if this thread helps:

    Cannot open database “” requested by the login. The login failed. Login failed for user 'sa'

    Another probability is that you have added a login user "Nur-Pc\Nurc" in your SQL Server, and it has no permission for the database "EyeClinic". So check it out, if you did added the user before, try to change the user's "User Mapping" property. Please refer to this article.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, November 8, 2013 7:57 AM
  • Hi Again. Thanks for your reply.

    I haven't attached any  database file. I've created database in sql server 2008 r2 enterprise by script.

    My database name is Eyeclinic.

    I can't add Nur-Pc\Nurc to login section in my database. It doesn't Recognized.

    Friday, November 8, 2013 7:34 PM
  • any one can help me ??????????????????????????
    • Marked as answer by Saeed Sohraby Monday, July 11, 2016 8:40 AM
    Monday, November 11, 2013 3:56 PM
  • <snipped>

    The Network is workgroup and my connection string is: connectionString="Data Source=192.168.1.100;Initial Catalog=EyeClinic;User ID=eyeclinic;Password=MyPassword

    <end>

    1) 192.168.1.100 is a dynamic IP from a DHCP server on a network that can be dynamically assigned to a computer, which is subject change and use by a computer that is not hosting SQL Server. You either use a static IP on the DHCP server on the LAN and assign it to the computer so that SQL Server can be found at all times, or the computer  name of the computer hosting SQL Server should be used instead of the IP address so that the computer can always be found by its name.

    Cannot open database “” requested by the login. The login failed. Login failed for user 'sa'

    2) The user ID of "sa" is the default Administrator account for SQL Server and that's a no-no account that should never be used in a connection string. The user-id and psw you have supplied in the connection string is not being honored, and somehow the "sa" account is supplanting it, which again the use of the "sa" account should not even be used in a connection string.

    3) http://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?category=sqlserver

    The above forum is where you should be posting to, because you are way off base and things are not right.

    • Proposed as answer by Fred Bao Wednesday, November 13, 2013 9:56 AM
    • Marked as answer by Fred Bao Thursday, November 14, 2013 9:49 AM
    • Unmarked as answer by Saeed Sohraby Tuesday, November 19, 2013 10:00 AM
    • Unproposed as answer by Saeed Sohraby Tuesday, November 19, 2013 10:00 AM
    Monday, November 11, 2013 8:48 PM
  • Cannot open database “” requested by the login. The login failed. Login failed for user 'sa'

    I see that it was posted by someone trying to help you, but I still suggest that you post to the SQL Server forum. And you should stop the usage of putting a dynamic DHCP IP in the connection string pointing to the computer, which is subject to be changed by the DHCP server on the network.

    Monday, November 11, 2013 9:00 PM
  • Hi Saeed,

    Thanks for your posting.

    From your description, I know that you encounter some issue  when  open database "EyeClinic" Requested by login, I think that this issue is  related to database , Data Platform Development Forum is more suitable for  it.So I move it to Data Platform Development Forum.

    Hope these help.


    Lilia Gong <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, November 12, 2013 6:38 AM
  • Hi to all.

    Thanks for your replies.

    But 192.168.1.100 IP is static and not dynamic.

    I used Computer Name too but it's not worked.

    What I don't understand is why system use windows authentication while i set Integrated Security=Off !!!!!!!!!!!!!!!!!!!!

    anyone knows that??????????????

    Thursday, November 14, 2013 12:37 PM
  • Please somebody HELP MEEEEE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Sunday, November 17, 2013 7:24 AM
  • Hi All.

    Thank's for your answers.

    I've found my problem's answer.

    There was an error in my connection string and when I corrected that my problem was solved.

    Thank you too much again.

    Have a nice day.

    • Marked as answer by Saeed Sohraby Wednesday, November 27, 2013 11:34 AM
    Wednesday, November 27, 2013 11:33 AM