private void button1_Click(object sender, EventArgs e) { ServiceReference1.NorthwindEntities proxy = new ServiceReference1.NorthwindEntities(new Uri("http://localhost:2111/NorthwindCustomers.svc/")); string city = textBox1.Text; if (city != "") { this.customersBindingSource.DataSource = from c in proxy.Customers where c.City == city select c; } }
private void Form1_Load(object sender, EventArgs e) { ServiceReference1.NorthwindEntities proxy = new ServiceReference1.NorthwindEntities(new Uri("http://localhost:2111/NorthwindCustomers.svc/")); this.customersBindingSource.DataSource = proxy.Customers; }