locked
Error in network SQL 2008 connection RRS feed

  • Question

  • Hi.

    I have wrote a code in c# .net 2010 for windows form application and my database is Microsoft sql server 2008 r2.

    In my program when i run it from local in my server or from my notebook in my LAN, everything is ok and no problem exist.

    But when i use other clients in LAN to run program there's error "Cannot open user default database. Login failed.
    Login failed for user 'Nur-pc\nur'. (Microsoft SQL Server, Error: 4064)" .

    What's the problem?!!!!!!!!!!!!

    anyone can help?

    Saturday, November 2, 2013 9:43 AM

Answers

  • Hello Saeed,

    By the error message it looks like you are using Windows authentication to logon to SQL Server.

    Have you a Windows domain or a workgroup; by the name "Nur-pc" I guess the last one? In a workgroup you can't use Windows authentication, you have to use SQL logins instead.


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    • Proposed as answer by Fanny Liu Monday, November 4, 2013 9:13 AM
    • Marked as answer by Fanny Liu Thursday, November 14, 2013 1:17 AM
    • Unmarked as answer by Saeed Sohraby Tuesday, November 19, 2013 9:59 AM
    • Unproposed as answer by Saeed Sohraby Tuesday, November 19, 2013 9:59 AM
    • Marked as answer by Saeed Sohraby Monday, July 11, 2016 8:11 AM
    Sunday, November 3, 2013 12:22 PM

All replies

  • Are you connecting to the same server in both cases? Are you logged in as the same user in both cases?


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
    Saturday, November 2, 2013 10:22 AM
  • Hello Saeed,

    By the error message it looks like you are using Windows authentication to logon to SQL Server.

    Have you a Windows domain or a workgroup; by the name "Nur-pc" I guess the last one? In a workgroup you can't use Windows authentication, you have to use SQL logins instead.


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    • Proposed as answer by Fanny Liu Monday, November 4, 2013 9:13 AM
    • Marked as answer by Fanny Liu Thursday, November 14, 2013 1:17 AM
    • Unmarked as answer by Saeed Sohraby Tuesday, November 19, 2013 9:59 AM
    • Unproposed as answer by Saeed Sohraby Tuesday, November 19, 2013 9:59 AM
    • Marked as answer by Saeed Sohraby Monday, July 11, 2016 8:11 AM
    Sunday, November 3, 2013 12:22 PM