New Posts New Posts RSS Feed: Call Connect() before doing a Login.
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Call Connect() before doing a Login.

 Post Reply Post Reply
Author
benmcneill View Drop Down
Newbie
Newbie
Avatar

Joined: 26-Aug-2010
Posts: 11
Post Options Post Options   Quote benmcneill Quote  Post ReplyReply Direct Link To This Post Topic: Call Connect() before doing a Login.
    Posted: 25-Oct-2010 at 6:11am
Ah....it wasn't rebuilding the xap and thus reading an old one...fixed now:)
Back to Top
benmcneill View Drop Down
Newbie
Newbie
Avatar

Joined: 26-Aug-2010
Posts: 11
Post Options Post Options   Quote benmcneill Quote  Post ReplyReply Direct Link To This Post Posted: 25-Oct-2010 at 5:56am
Thanks,

Have tried below, but I get nothing. I tried the boolean haserror property also, but nothing, not even a message box. If I delete the entire Login Method, i still get the exception, even though LoginAsync isn't being called anywhere in the program. It's as if the whole method is being completely ignored but Login() is called upon Page_Loaded. Weird thing is, this error only started appearing after I added a new project to the solution. This didn't change the startup project or cause and inconsistencies either.

            private void Login()
            {
                ILoginCredential credential = null;
                credential = new FormsAuthenticationLoginCredential("user", "password", "BEN-NOTEBOOK", true);

                EntityManager.ConnectAsync(op =>
                {
                    var results = op.Error.Message;
                    MessageBox.Show(results.ToString());
                    EntityManager.LoginAsync(credential, LoginCompleted, null);
                });
            }
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 24-Oct-2010 at 8:20am
The connect call is probably failing for some reason.  Check the op.Error returned by ConnectAsync to see what's going on.
Back to Top
benmcneill View Drop Down
Newbie
Newbie
Avatar

Joined: 26-Aug-2010
Posts: 11
Post Options Post Options   Quote benmcneill Quote  Post ReplyReply Direct Link To This Post Posted: 23-Oct-2010 at 9:09pm
Hi Guys

I've read the other forum posts on this issue but just can't figure it out.

Several seconds after my app loads in Browser, I get "InvalidOperationException: Call Connect() before doing a Login".

Thing is, I am calling this. I have, in the Login() method upon Load:

private void Login()
{
       ILoginCredential credential = null;
       credential = new FormsAuthenticationLoginCredential("user", "password", "BENDESKTOP", true);

       EntityManager.ConnectAsync(op =>
       {
           EntityManager.LoginAsync(credential, LoginCompleted, null);
       });
}

If I completely remove the LoginAsync call, I still get told to Connect before logging in too. I had the app running fine for weeks, and all I did to change it was add a new project to the solution, so can't work out what's happening.

I originally had ConnectAsync and then LoginAsync separately (instead of LoginAsync call within ConnectAsync call) but the result was the same, as is to be expected I guess.

Anybody able to assist? Would be greatly appreciated. (I'm sure it's something simple).

Thanks in advance!

Cheers,
Ben
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down