[英]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.