CodeSmith Community
Your Code. Your Way. Faster!

Login failed for user 'COMPUTERNAME\\Guest'.

Latest post 08-05-2008 10:44 PM by SuperJeffe. 5 replies.
  • 08-05-2008 7:24 AM

    • fweeee
    • Top 25 Contributor
    • Joined on 08-08-2007
    • Posts 203
    • Points 5,048

    Login failed for user 'COMPUTERNAME\\Guest'.

    I'm testing my winforms application, trying to connect to it via a remote computer, and it has problems, giving me the message above.

    A little background:

    I have written this winforms application so it is possible to change the database at runtime.

    It works flawlessly when using it locally (mostly tested on a vista machine, with SQL Server 2005 enterprise version).

    Have just installed it on a win xp machien, running SQL Server express. I can connect to this database when our application is installed on the XP machien. But when the application is installed on another machine on the network, I get the message when I try to read a table "Login failed for user 'COMPUTERNAME\\Guest'." (COMPUTERNAME is the name of the machine the sql express server resides on).

    I am quite confident the username and password I have entered when switching databases is correct (username is 'sa'). I am able to connect to the sqlexpress database from the network (tested it with MS SQL management Studio).

    As far as I can tell, the code I'm using to change databases is this:

                        NetTiersProvider provider = DecEzy.Data.SqlClient.Utils.AddDataProvider(connName, connString);

                        //change provider to be current data provider
                        ConnectionScope.Current.DataProvider = provider;

    Any assistance would be appreciated.

    • Post Points: 65
  • 08-05-2008 8:27 AM In reply to

    • vbandrade
    • Top 25 Contributor
    • Joined on 09-27-2007
    • Brasil
    • Posts 254
    • Points 6,460

    Re: Login failed for user 'COMPUTERNAME\\Guest'.

    Please, check you connection string and look for Windows Authentication... it should be something like: "Integrated Security=SSPI".

    You should not have that in you connection string, if you do, update the connection string to use login and password.

     

    That would be my first guess.

    • Post Points: 35
  • 08-05-2008 4:34 PM In reply to

    • blake05
    • Top 10 Contributor
    • Joined on 04-03-2008
    • Wisconsin
    • Posts 565
    • Points 10,500

    Re: Login failed for user 'COMPUTERNAME\\Guest'.

    Reply |Contact |Answer

    Hello,

    Could you double check you have followed the steps outlined in this document to enable remote SQL Express connections.

    I would also set the connection string in the web.config for .netTiers. This would allow you to check to make sure this connection works without dynamically adding the new dataprovider.

    Thanks

    -Blake Niemyjski

    Blake Niemyjski

    CodeSmith Tools, LLC. Software Development Engineer

    Blog: http://windowscoding.com/blogs/blake/

    ----------------------------------------------------------------------
     Member of the .NetTiers team | Visit http://www.nettiers.com
    ----------------------------------------------------------------------

    • Post Points: 5
  • 08-05-2008 6:08 PM In reply to

    • fweeee
    • Top 25 Contributor
    • Joined on 08-08-2007
    • Posts 203
    • Points 5,048

    Re: Login failed for user 'COMPUTERNAME\\Guest'.

    Thanks vbandrade - that was spot on.

    blake - your suggestion was close. I was having those problems earlier on, but found the very same website you suggested (it ended up being the firewall)

     

    • Post Points: 35
  • 08-05-2008 8:57 PM In reply to

    • vbandrade
    • Top 25 Contributor
    • Joined on 09-27-2007
    • Brasil
    • Posts 254
    • Points 6,460

    Re: Login failed for user 'COMPUTERNAME\\Guest'.

    fweeee:
    Thanks vbandrade - that was spot on.

    yay!

    That's why I'm not humble enough... haha

     

    • Post Points: 35
  • 08-05-2008 10:44 PM In reply to

    • SuperJeffe
    • Top 25 Contributor
    • Joined on 05-05-2006
    • Tulsa, Ok
    • Posts 444
    • Points 11,000

    Re: Login failed for user 'COMPUTERNAME\\Guest'.

    vbandrade:

    fweeee:
    Thanks vbandrade - that was spot on.

    yay!

    That's why I'm not humble enough... haha

     

     

    LOL

    ----------------------------------------------------------------------
     Member of the .NetTiers team | Visit http://www.nettiers.com
    ----------------------------------------------------------------------

    • Post Points: 5
Page 1 of 1 (6 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems