[OperationContract] public IQueryable SelectAllTesting() { DataClasses1DataContext db = new DataClasses1DataContext(); return (IQueryable)(from a in db.Employees join b in db.Companys on a.Employeeid equals b.Employeeid select new { a.Employeeid, a.EmployeeName, b.Companyname }); }
public partial class MainPage : UserControl { ServiceReference1.Service1Client client = new ServiceReference1.Service1Client(); public MainPage() { InitializeComponent(); } void client_SelectAllTestingCompleted(object sender, ServiceReference1.SelectAllTestingCompletedEventArgs e) { MessageBox.Show(e.ToString()); dataGrid1.ItemsSource = (IQueryable)e.Result; MessageBox.Show(e.ToString()); } private void button1_Click(object sender, RoutedEventArgs e) { client.SelectAllTestingCompleted += new EventHandler<ServiceReference1.SelectAllTestingCompletedEventArgs>(client_SelectAllTestingCompleted); client.SelectAllTestingAsync(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)