i have spend hours looking for the problem. I have this code that
then when i did a "SELECT DISTINCT category from tbldice" i found out that loadcsv added a strange and undisplayed unicode at the beginning of the data. When i copied and pasted the log to dbfiddle i found out its adding "ZERO WIDTH NO-BREAK SPACE" with the unicode 65279 to the beginning of the string.
you can take a look at the testdb and run the "SELECT DISTINCT category from tbltest", you will notice that category "aa" is duplicated because of the unseen unicode.
can somebody explain whats going on?
loadcsv:
Dim strSQL As String = "INSERT into tbldice (category,question) VALUES "
For Each myrow() As String In su.LoadCSV (Dir,FileName,";")
strSQL = strSQL & "("
For Each strData As String In myrow
strSQL = strSQL & "'" & strData & "',"
Next
strSQL = strSQL.SubString2(0,strSQL.Length-1)
strSQL = strSQL & "),"
Next
strSQL = strSQL.SubString2(0,strSQL.Length-1) & ";"
Main.sql.execnonquery(strSQL)
then when i did a "SELECT DISTINCT category from tbldice" i found out that loadcsv added a strange and undisplayed unicode at the beginning of the data. When i copied and pasted the log to dbfiddle i found out its adding "ZERO WIDTH NO-BREAK SPACE" with the unicode 65279 to the beginning of the string.
you can take a look at the testdb and run the "SELECT DISTINCT category from tbltest", you will notice that category "aa" is duplicated because of the unseen unicode.
can somebody explain whats going on?