Reputation: 67
i write code that insert some data into Microsoft Access database but i have an error "Syntax error in insert into statement" i don't know why !!!Please help me. thanks Advance
Its showing below error
Upvotes: 0
Views: 295
Reputation: 13474
Try this.Remove ; and put BookName instead of book name
oleDbCmd.CommandText = "insert into book (BookName,Description) values ('" +textBookName.Text+ "','" +textDescription.Text+ "')";
Upvotes: 0
Reputation: 58703
Due to the space in the column name, I think you need to delimit the "Book Name" identifier with square brackets, i.e.:
insert into book ([Book Name],Description)
Upvotes: 3