My program is written in VB.NET and I have an excel sheet with only one column and type of column is Text. Now I want to add all the rows of excel sheet into MS Access table.
My Access table has 5 columns, and I have to provide some static data for rest of fields. I can't let them empty as my table structure won't allow me to let them empty. they are mandatory.
My algorithm works this way
- Read excel sheet data into a DataTable
- Loop to the end of all rows of DataTable
Append text of each cell and some of my static information to make a query string
INSERT into TableName(c1,c2,c3) values (v1,v2,v3), (v1,v2,v3), (v1,v2,v3), (v1,v2,v3) ... ... (n1,n2,n3);
- Execute this query
But I got error in this query, Any suggestions?