Hello all - my first post here. I'm a VB newbie building an app that relies on generating csv files and later reading them into a SQLServerCE 3.5b2 table.
While debugging, I discovered that all csv files generated include hex: ef bb bf at beginning of string and this is causing havoc when attempting to read the file into the table (works fine if I edit them out first).
I narrowed things down to these statements used in the generation of the csv which provokes the issue:
Dim
dataStr As New System.Text.StringBuilder() My.Computer.FileSystem.WriteAllText("test.txt", dataStr.ToString(), False)
This code will produce an 'empty' txt file except for the hex values ef bb bf (which are not viewable in notepad). Using these statements in a larger block of code to build the csv results in an otherwise perfect csv except for the same leading hex values.
I tried using dataStr.Remove to strip the hex no avail. So my questions are:
1) Is this 'normal behavior', a bug, or am I doing something wrong
2) How can I avoid this or at least strip the 'trash' off the front of these files
Thanks in advance for any help!
Regards,
skitron
BTW - this is true in both VB Express 2005 sp1 and 2008 b2