private void button2_Click(object sender, EventArgs e) { int x = Int32.Parse(txtSearch.Text); ServiceReference1.myData d = proxy.searchData(x); if (d != null) { textBox2.Text = d.name; textBox3.Text = d.image; } }
private void button1_Click(object sender, EventArgs e) { ServiceReference1.myData d = new ServiceReference1.myData { //id = Int32.Parse(textBox1.Text), name = textBox2.Text, image = textBox3.Text }; proxy.Create(d); dataGridView1.DataSource = proxy.AllData(); }
private void button3_Click(object sender, EventArgs e) { try { ServiceReference1.myData d = new ServiceReference1.myData { id = Int32.Parse(txtSearch.Text), name = textBox2.Text, image = textBox3.Text }; proxy.update(d); MessageBox.Show("Data Updated Successfully"); dataGridView1.DataSource = proxy.AllData(); } catch (Exception ex) { MessageBox.Show("Error" + ex.Message); } }