[thelist] Weird Data from Text File: 

Marin Gatellier billybad at belgacom.net
Tue Mar 11 04:27:43 CDT 2008


Hi Casey,

This is an Unicode BOM (Byte Order Marker), it is used by older software to 
mark the file as Unicode.

It can be safely removed by editing your csv file in let's say Notepad++ 
with the "Format" Menu, select the "Encode in ANSI" then go back to the 
"Format" and choose the "UTF-8 without BOM" option

Regards,
Marin

----- Original Message ----- 
From: "Casey Crookston"
Subject: [thelist] Weird Data from Text File: 


Hey there, I'm seeing something really odd in a pretty simple select I'm
doing out of a comma delimited text file:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dim TextConn As New
System.Data.OleDb.OleDbConnection(WebConfigurationManager.ConnectionStrings("ImportCats").ConnectionString)

Dim daSource As New System.Data.OleDb.OleDbDataAdapter("SELECT * FROM
cats.txt", TextConn)

daSource.AcceptChangesDuringFill = False

Dim dtSource As DataTable = New DataTable

daSource.Fill(dtSource)

GridView1.DataSource = dtSource

GridView1.DataBind()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In web.config:

<add name="ImportCats"
connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Inetpub\wwwroot\xxxxxxx\scripts\;Extended
Properties='Text;HDR=Yes;FMT=Delimited;'" />

To see why the data was not importing into the DB, I outputed the the
datatable to the screen in the gridview you see above.  Here is what I saw
for the first column's name:

Advertiser

I have NO idea where the  is coming from!  It most certainly is not in
the text file!!!

Any ideas?

Thanks,

Casey





More information about the thelist mailing list