What i want to do is simple,
First delete existing records,
and then insert new records... When a button is clicked.
Both of my codes work successfully, but NOT TOGETHER... It works when its separate.. Delete doesnt work when both code are put in same button click function.. but if insert is removed, delete works..
Delete Code:
SqlConnection connection = new SqlConnection(WebConfigurationManager.ConnectionStrings["ApplicationServices"].ToString());
string sqlStatement = "DELETE from interests where FK_is_id=1";
SqlCommand cmd = new SqlCommand(sqlStatement, connection);
connection.Open();
cmd.ExecuteNonQuery();
connection.Close();
connection.Dispose();
Insert Code:
for (int j = 0; j < CheckBoxList1.Items.Count - 1; ...
Go to the complete details ...