I would like to use sqlbulkcopy to move values from a csv file into sql server. The problem I have is that the csv is double quoted and comma delimited. I believe that sqlbulkcopy won't work with double quotes from code behind as a delimiter. Does anyone know if there is a way to get the values in "as is", or am I stuck cleaning the quotes? One reason I would prefer against it is that some values contain commas such as...
"Value 1","Company, Inc","Value 2"
By cleaning the double quotes, I introduce new commas.
The code I have is as follows...
Dim file As New StreamReader(companyListFile)
Dim csv As New LumenWorks.Framework.IO.Csv.CsvReader(file, True, ","c)
Dim copy As New SqlBulkCopy(objConn)
copy.DestinationTableName = "[CompanyList]"
copy.WriteToServer(csv)
Any ideas are appreciated, thanks!