(My problem solved. As almost everyone said I had to remove @OB_ID and left it to SQL to assign value.)
I want to insert a new record into a table in SQL database th
Replace Following
SqlCommand cmd2 = new SqlCommand("INSERT INTO Order_Book VALUES( @OB_Title, @OB_Author, @OB_TranslatedBy, @OB_Publisher)", sqlc);
//@OB_ID is indentity primary key
With
SqlCommand cmd2 = new SqlCommand("SET IDENTITY_INSERT Order_Book ON;INSERT INTO Order_Book VALUES( @OB_Title, @OB_Author, @OB_TranslatedBy, @OB_Publisher);SET IDENTITY_INSERT Order_Book OFF;", sqlc);
//@OB_ID is indentity primary key