简体   繁体   English

从服务器发送列表,但如何在客户端(WCF)C#中打印

[英]send a list from server, but how to print in the client (WCF) C#

i have a server\\client (WCF) application, i need to send a list of string from the server to the client let's say the function on the server 我有一个服务器\\客户端(WCF)应用程序,我需要从服务器向客户端发送字符串列表,比方说服务器上的函数

List<string> RetrieveEmp (){
:
:
:

return EmpName.ToList();
}

I want to show the Employees name's list in client side (win phone 7 app) 我想在客户端显示员工姓名列表(Win Phone 7应用)

    client.RetrieveEmpCompleted += new EventHandler<RetrieveEmpCompletedEventArgs>(client_RetrieveEmpCompleted)

   client. RetrieveEmpAsync();

I tried to do it like that 我试图那样做

  void client_RetrieveEmpCompleted(object sender, RetrieveEmpCompletedEventArgs e(
        {
         // I tried to do it like that 
         //  foreach (var i in e.Result.ToList())
        // {
                listBox1.ItemsSource = e.Result;//e.ResultElementAt(1)
            //}
        }

But it doesn't work , any kind of help I will be so thankful to you, I appreciate, if you provide any sample code. 但这是行不通的 ,如果您提供任何示例代码,我将非常感谢您的任何帮助 thank you, 谢谢,

List<String>RetrieveEmp 
{
DataClasses1DataContext context = new DataClasses1DataContext();
from (r in context.tablename select r.EmpName).toList();
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用C#将对象从RESTful客户端发送到WCF RESTful服务器 - how to send an object from RESTful client to WCF RESTful server using C# 从客户端向WCF Server C#发送图像错误(Base-64字符数组的长度无效) - Error send image from client to WCF Server C# (Invalid length for a Base-64 char array) 如何将屏幕截图从 C# 服务器发送到 android 客户端? - How to send screenshots from C# server to android client? 从服务器发送消息到客户端c# - Send message from server to client c# C#WCF将数据从服务器上运行的任务传递到客户端 - C# WCF pass data from Task running on Server to Client 如何使用WCF从客户端向服务器发送大文件? - How to Send Large File From Client To Server Using WCF? 如何从sql server播放mp3字节块,使用C#转移到桌面客户端(通过wcf)? - how to play chunks of mp3 bytes from sql server, transferred to desktop client (by wcf) using C#? C#或C / C ++如何从客户端接收数据包,过滤并将其重定向到服务器,从服务器接收并发送至客户端 - C# or C/C++ How to receive packets from client, filter & redirect them to server, receive from server & send to client 将服务器发送到客户端C# - send server to client C# 将float数组从C ++服务器发送到C#客户端 - Send float array from C++ server to C# client
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM