本文介绍了如何将数据从wcf序列化到Windows Phone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在wcf中,我正在使用此代码

in wcf i am using this code

public List<customer> login(string salesmanname, string usercode)
{
    List<customer> customers = new List<customer>();
    con.Open();
    using (SqlCommand cmd = new SqlCommand("Select Id, CompanyRefId from SalesMan where salesmanname=@salesmanname and code=@usercode", con))
    {
        cmd.Parameters.AddWithValue("@salesmanname", salesmanname);
        cmd.Parameters.AddWithValue("@usercode", usercode);
        using (SqlDataReader reader = cmd.ExecuteReader())
        {
            while (reader.Read())
            {
                customer c1 = new customer();
                c1.id = (int)reader["Id"];
                c1.companyrefid = (Guid)reader["CompanyRefId"];
                customers.Add(c1);

            }
            return customers;
        }

    }
}



在Windows Phone中,我正在使用此代码



in windows phone i am using this code

string username = salesmannames.SelectedItem.ToString();
               string password = textBox1.Text.ToString();
                proxy.loginAsync(username, password);
                proxy.loginCompleted += new EventHandler<loginCompletedEventArgs>(loginfn);

void loginfn(object sender, loginCompletedEventArgs e)
       {
           if (e.Result != null)
           {
               customer ad = new customer();


               NavigationService.Navigate(new Uri("/customernames.xaml", UriKind.Relative));
           }
       }



我想设置id = 1
and companyrefid = 13444;
如何在Windows Phone代码中执行此操作?



i want to set id = 1
and companyrefid= 13444;
how to do that in windows phone code ?

推荐答案


这篇关于如何将数据从wcf序列化到Windows Phone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 00:23