exception occur i my code is:
Violation of PRIMARY KEY constraint 'PK__lib_book__1ADC427003317E3D'. Cannot insert duplicate key in object 'dbo.lib_book_details'.
The statement has been terminated.
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_book_details set book_tag_id=@book_tag_id,book_name=@book_name,book_author_name=@book_author_name where book_category_id=@book_category_id", cs);
da.UpdateCommand.Parameters.Add("@book_tag_id", SqlDbType.Int).Value = textBox1.Text;
da.UpdateCommand.Parameters.Add("@book_name", SqlDbType.VarChar).Value = textBox2.Text;
da.UpdateCommand.Parameters.Add("@book_category_id", SqlDbType.Int).Value = Convert.ToInt32(comboBox1.SelectedValue);
da.UpdateCommand.Parameters.Add("@book_author_name", SqlDbType.VarChar).Value = textBox3.Text;
cs.Open();
MessageBox.Show("new book updated!");
da.UpdateCommand.ExecuteNonQuery();
cs.Close();