|
-
Feb 13th, 2008, 04:47 PM
#1
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...
-
Feb 13th, 2008, 04:53 PM
#2
Thread Starter
PowerPoster
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!
-
Feb 14th, 2008, 12:15 PM
#3
Thread Starter
PowerPoster
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|