[已解决]如何将Web服务列表传输到Windows 8应用程序? [英] [Solved]How i transfer web service list to windows 8 app?

查看:121
本文介绍了[已解决]如何将Web服务列表传输到Windows 8应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[WebMethod]
public List<string> getParameters()
        {
            DataSet ds = new DataSet();
            string connect = "Data Source=BERKAY-PC\\SQLEXPRESS;Initial Catalog=Hastahane;Integrated Security=True;";
            SqlConnection deneme = new SqlConnection(connect);
            //SqlCommand komut = new SqlCommand("SELECT * FROM [User]", deneme);
            SqlDataAdapter da = new SqlDataAdapter();
            da.SelectCommand = new SqlCommand("SELECT * FROM [User]", deneme);
            da.Fill(ds, "[User]");
            List<string> AdSoyadcek = (from TC in ds.Tables["[User]"].AsEnumerable() select TC.Field<string>("AD") + " " + TC.Field<string>("SOYAD")).ToList();
            return AdSoyadcek;
        }


我有2个项目(已连接).第一个C#Windows 8应用程序.第二个是ASP.NET Web窗体.我在Web服务中有一个列表.但是我无法将其转移到Windows 8应用程序.我不能在其中使用响应".我该怎么做?
提前谢谢.
====解决方案=如果我们在课程上添加[可序列化],则问题就消失了.====


I have 2 project(connected).The 1st one C# Windows 8 app. 2nd one is ASP.NET Web Forms. I have a list in the web service . But i cant transfer this to Windows 8 app. I can''t use "Response" in there. How can i make this?
Thanks in advance.
====Solution= If we add [Serializable] on the class the problem was dissappear.====

推荐答案

回答仅从未答复的列表中删除:已解决通过OP.
Answered only to remove from unanswered list: solved by OP.


这篇关于[已解决]如何将Web服务列表传输到Windows 8应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆