1try
2 {
3 connection.Open();
4 cmd = connection.CreateCommand();
5 cmd.CommandText = "INSERT INTO BOOK(ISBN, title, author, publisher,imgPath, catalogID) VALUES ('" + isbn + "','" + title + "','" + author + "','" + publisher + "','" + localPath + "','" + catalogid + "')";
6 int a= cmd.ExecuteNonQuery();
7 if(a>0)
8 //updated.
9 else
10 //Not updated.
11 }
12catch (Exception)
13 {
14 //Not updated.
15 }