0
votes

I'm trying to do something really simple here - just enter multiple rows into a excel spreadsheet.

This works totally fine when I'm only entering 1 row into it. But when I try to enter the second row, it gives me a OleDbException saying 'Missing Semicolon (;)'

I've tried all sorts of SQL statements for it, but still no luck with it. Can someone please tell me what I'm doing wrong and how to get around this please??

This is the code I've got:

string insertSql = "INSERT INTO Sheet1 (ID, [Company Name]) VALUES (1, 'test 1'), (2, test 2);";
1

1 Answers

0
votes

You can try creating query like this.

string insertSql = "INSERT INTO Sheet1 (ID, [Company Name]) VALUES (1, 'test 1'); INSERT INTO Sheet1 (ID, [Company Name]) VALUES (2, test 2);"