Reading CSV into Dataset no column names

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tshad

    Reading CSV into Dataset no column names

    I have a csv file that I am reading into my dataset. But I want to ignore
    any rows that have nothing in the 3rd column - something like:

    da = new OleDbDataAdapte r("SELECT * FROM " +
    Path.GetFileNam e(strFile) + "WHERE F3 is not null",csvConnec tion);

    or Where F3 = ''

    where F3 would be some type of column number. The problem is I don't have
    any column names as I am reading this from a csv text file.

    How would I do this?

    Thanks,

    Tom


  • christery@gmail.com

    #2
    Re: Reading CSV into Dataset no column names

    and where does F3 come from? I'd name columns to have a name I put
    there...
    look at http://msdn2.microsoft.com/en-us/library/ms709353.aspx for
    additional info on schema.ini
    //CY Who stole chr$(12)?

    Comment

    • sloan

      #3
      Re: Reading CSV into Dataset no column names


      If you don't have columns , you define them in a seperate file..that resides
      in the SAME directory.



      I think its called "schema.ini ", but can't remember exactly.

      But there is a way...hopefully that will help.



      "tshad" <tshad@dslextre me.comwrote in message
      news:%23EX0e5qa IHA.4196@TK2MSF TNGP04.phx.gbl. ..
      I have a csv file that I am reading into my dataset. But I want to ignore
      any rows that have nothing in the 3rd column - something like:
      >
      da = new OleDbDataAdapte r("SELECT * FROM " +
      Path.GetFileNam e(strFile) + "WHERE F3 is not null",csvConnec tion);
      >
      or Where F3 = ''
      >
      where F3 would be some type of column number. The problem is I don't have
      any column names as I am reading this from a csv text file.
      >
      How would I do this?
      >
      Thanks,
      >
      Tom
      >
      >

      Comment

      Working...