I am trying to insert a datatable into a SQL server DB table. I am getting error “Incorrect syntax near ‘,’.” What do you think the reason might be, because i am not writing a sql query, I am just inserting the whole datatable. I made sure, that both the table and datatable have similar columns.
same issue here, any news?
Hey, in my case the reason was that I was trying to Insert empty Data table, If condition to check if data table has any values fixed the issue.
Hey, In my case, one of the column has special characters. I tried to save the error message in the column and the message has some special characters.
How did you replace them in a data table if you don´t mind mentioning?
I found the solution in the below link. Escape the apostrophe (i.e. double-up the single quote character) in your SQL: