DateTime format is not supported in ADO.NET

  • Thread starter Thread starter Shiplu
  • Start date Start date
S

Shiplu

hi,
I have a example.csv file. it looks something like this,
ID,START,END,OWNER,DOMAIN
115862,7/16/2006 8:16,7/16/2006 8:16,PRIVATE,PRIVATEDOMAIN
115443,7/16/2006 3:46,7/16/2006 3:46,SKYCALL4,SKYCALLDOMAIN4
115230,7/16/2006 0:54,7/16/2006 0:54,BIJOY,BIJOYDOMAIN
114541,7/15/2006 21:21,7/15/2006 21:21,BEST6,BEST6DOMAIN
114480,7/15/2006 21:11,7/15/2006 21:11,B17,B17DOMAIN

It's Schema.ini file,
[example.csv]
Format=CSVDelimited
ColNameHeader=true
Col1=ID Long
Col2=START Date
Col3=END Date
Col4=OWNER Text
Col5=DOMAIN Text

when I query this file, It says type mismatch for Col2 and Col3
I know they are not date rather datetime, and there is no datetime
format ?
but I need information of min/sec also.
is there any way to use datetime format.
 
Hello Shiplu,

You're probably going to need to import it as a string then parse the date
and time separately. I don't think this format is supported 'natively'.

Thanks,
Shawn Wildermuth
Speaker, Author and C# MVP
http://adoguy.com
 
You can format the date, i used:

DateTimeFormat=yyyy-mm-dd hh:nn

So maybe with some tweaking your df is there?
 
*maybe*.. in the SELECT you could try to use: CVDate( [the field] )



Edwin Knoppert said:
You can format the date, i used:

DateTimeFormat=yyyy-mm-dd hh:nn

So maybe with some tweaking your df is there?



Shiplu said:
hi,
I have a example.csv file. it looks something like this,
ID,START,END,OWNER,DOMAIN
115862,7/16/2006 8:16,7/16/2006 8:16,PRIVATE,PRIVATEDOMAIN
115443,7/16/2006 3:46,7/16/2006 3:46,SKYCALL4,SKYCALLDOMAIN4
115230,7/16/2006 0:54,7/16/2006 0:54,BIJOY,BIJOYDOMAIN
114541,7/15/2006 21:21,7/15/2006 21:21,BEST6,BEST6DOMAIN
114480,7/15/2006 21:11,7/15/2006 21:11,B17,B17DOMAIN

It's Schema.ini file,
[example.csv]
Format=CSVDelimited
ColNameHeader=true
Col1=ID Long
Col2=START Date
Col3=END Date
Col4=OWNER Text
Col5=DOMAIN Text

when I query this file, It says type mismatch for Col2 and Col3
I know they are not date rather datetime, and there is no datetime
format ?
but I need information of min/sec also.
is there any way to use datetime format.
 
hi,

Edwin said:
You can format the date, i used:

DateTimeFormat=yyyy-mm-dd hh:nn

i guess, my format would be mm/dd/yyyy hh:nn
can you tell me the full doc of writing that format ?
 
Afaik i found it somewhere on the internet, seems different then ASP.NET's
format (like MM for month etc..)
So google..

Also, it seems SQL can work with azian date notation.
So please try CVDate() with yyyy-mm-dd notation, maybe it works.
 
Back
Top