Results 1 to 10 of 10

Thread: [RESOLVED] CSV to XML

Hybrid View

  1. #1
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: [RESOLVED] CSV to XML

    What is the data type of that column in your datatable? From the value you show in your csv file and the value you have when you do ToString of the datatable item, it does look like the column is of DateTime type. Try this and see if you get the same value as in the csv file
    Code:
    MessageBox.Show(CDate(dt.Rows(0).Item(0)).ToString("yyyy-MM-dd HH:mm"))
    And we'll go from there...

  2. #2

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    My Mustang GT
    Posts
    4,566

    Re: [RESOLVED] CSV to XML

    Thank you for chiming back in to this "resolved" thread!

    I did what you asked and got this:
    ? CDate(dt.Rows(0).Item(0)).ToString("yyyy-MM-dd HH:mm")
    "2008-02-09 20:00"
    (By the way, it's a web app so I couldn't do a message box, but I'm sure that's of no importance).

    I didn't define my datatable columns to be of any type, that's what I thought was so easy about it, all I did was:
    dt = New DataTable(System.IO.Path.GetFileNameWithoutExtension(filePath))
    It seemed to default to whatever it wanted.

    Well, I appreciate your help and I'll be back online tomorrow...the weather in CT stinks right now, I have a terrible chest cold, and it's time to get home and pay the babysitter for a full day (because of cancelled school due to the weather!)

    Thanks.

    Thanks!

  3. #3

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    My Mustang GT
    Posts
    4,566

    Re: [RESOLVED] CSV to XML

    Do you have anything else to add?

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width