As i click update button data is updated but all the data in the table get with it....(same data in whole table)
suggest me what i doing WRONG in it....
private void btnUpdate_Click(object sender, EventArgs e)
{
SqlConnection cs = new SqlConnection("Data Source=IRIS-CSG-174;Initial Catalog=library_system;Integrated Security=True");
SqlDataAdapter da = new SqlDataAdapter();
da.UpdateCommand = new SqlCommand("Update Lib_member_details set member_name=@member_name,member_address=@member_address,member_contact_number=@member_contact_number,member_email_id=@member_email_id,member_password=@member_password,membershiptype_id=@membershiptype_id", cs);
da.UpdateCommand.Parameters.Add("@member_name", SqlDbType.VarChar).Value = textBox2.Text;
da.UpdateCommand.Parameters.Add("@member_address", SqlDbType.VarChar).Value = textBox3.Text;
da.UpdateCommand.Parameters.Add("@member_contact_number", SqlDbType.Int).Value = Convert.ToInt32(textBox4.Text);
da.UpdateCommand.Parameters.Add("@member_email_id", SqlDbType.VarChar).Value = textBox5.Text;
da.UpdateCommand.Parameters.Add("@member_password", SqlDbType.Int).Value = Convert.ToInt32(textBox6.Text);
da.UpdateCommand.Parameters.Add("@membershiptype_id", SqlDbType.Int).Value = Convert.ToInt32(comboBox1.SelectedValue);
cs.Open();
MessageBox.Show("member data updated!");
da.UpdateCommand.ExecuteNonQuery();
cs.Close();