Click here to Skip to main content
15,922,419 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have webservice and windows phone app. I need to pass an variable from web service to windows phone app
Web service:

C#
public String ValidateQuery(string name, string password)
      {
          string s="";
          OleDbConnection con2 = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Amma\Documents\UserData.accdb");
          OleDbCommand cmd = new OleDbCommand("SELECT count(*) from login WHERE name='" + name + "' and pwd='" + password + "'", con2);
          con2.Open();
          OleDbDataReader da = cmd.ExecuteReader();
          while (da.Read())
          {
              if (da.HasRows == true)
              {
                  s = "OK";
                  break;
              }
              else
              {
                  s = "Not Ok"; // I need to pass this variable.
                  break;
              }
          }

My WP7 mehtod:
Test.xaml.cs
C#
private void btnLogin_Click(object sender, RoutedEventArgs e)
{
    string uname=textBoxName.Text;
    string pwd=textBoxPwd.Text;
    myService.Service1SoapClient client = new Service1SoapClient();
   client.ValidateCompleted += new EventHandler<ValidateCompletedEventArgs>(client_ValidateCompleted);
    client.UpdateQueryAsync(uname, pwd);
    string result= // here i need get that string here.

}

If ther any other to achieve this action pls help me.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900