none
Read hyphen from a CSV file RRS feed

  • Question

  • I have a vb.net application which reads a CSV file using OLEDB dataadapter into a datatable. I have a scenario where the cells can contain only a hyphen(-). But the dataadapter reads it as zero(0).

    Below is the piece of code that i use:

    CSVConString =

    "Provider=Microsoft.Jet.OleDb.4.0; Data Source=" + System.IO.Path.GetDirectoryName(sfilePath) + ";Extended Properties=""text;HDR=YES;FMT=Delimited;IMEX=1"""

    Dim

     

    CSVAdapter As New OleDb.OleDbDataAdapter(commandText, CSVConString)

    CSVAdapter.Fill(dtblProperty)

     

     

    Please suggest a solution.Thanks.

    Thursday, December 2, 2010 8:10 AM

Answers