Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Import Data from CSV into Datatable

Import Data from CSV into Datatable

Scheduled Pinned Locked Moved C#
question
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    polishprogrammer
    wrote on last edited by
    #1

    "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=\"" + dir + "\\\";" + "Extended Properties=\"text;HDR=No;FMT=Delimited\""; I'm using the above connection, together with a SELECT * FROM file statement, to pull in data from a comma-delimited text file, where dir is the directory where the file is located and file is the name of the csv file. This works well for files that contain English characters only, but for any file that uses non-English (ASCII) characters, the expression fails. I have written the csv file using a StreamWriter with Encoding=UTF8 so the characters display fine when viewed in Notepad or Excel, but when pulled into the DataTable, the value in the table is blank. Is there some Extended Property that can be used to permit East Asian characters, say, to be displayed properly? Thanks.

    D 1 Reply Last reply
    0
    • P polishprogrammer

      "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=\"" + dir + "\\\";" + "Extended Properties=\"text;HDR=No;FMT=Delimited\""; I'm using the above connection, together with a SELECT * FROM file statement, to pull in data from a comma-delimited text file, where dir is the directory where the file is located and file is the name of the csv file. This works well for files that contain English characters only, but for any file that uses non-English (ASCII) characters, the expression fails. I have written the csv file using a StreamWriter with Encoding=UTF8 so the characters display fine when viewed in Notepad or Excel, but when pulled into the DataTable, the value in the table is blank. Is there some Extended Property that can be used to permit East Asian characters, say, to be displayed properly? Thanks.

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      Does this[^] helps?

      जय हिंद

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups