Click here to Skip to main content
16,005,037 members
Home / Discussions / C#
   

C#

 
GeneralRe: Formatting excel file column Pin
CodingLover26-Mar-09 23:16
CodingLover26-Mar-09 23:16 
Questionxna first person shooter: strafing Pin
James_72226-Mar-09 21:08
James_72226-Mar-09 21:08 
AnswerRe: xna first person shooter: strafing Pin
Christian Graus26-Mar-09 21:56
protectorChristian Graus26-Mar-09 21:56 
GeneralRe: xna first person shooter: strafing Pin
James_72227-Mar-09 2:56
James_72227-Mar-09 2:56 
QuestionHow to read files using FolderBrowserDialog and save its contents into sql database table Pin
Nopo26-Mar-09 21:03
Nopo26-Mar-09 21:03 
AnswerRe: How to read files using FolderBrowserDialog and save its contents into sql database table Pin
King Julien26-Mar-09 21:49
King Julien26-Mar-09 21:49 
GeneralRe: How to read files using FolderBrowserDialog and save its contents into sql database table Pin
Nopo26-Mar-09 23:19
Nopo26-Mar-09 23:19 
GeneralRe: How to read files using FolderBrowserDialog and save its contents into sql database table Pin
King Julien26-Mar-09 23:59
King Julien26-Mar-09 23:59 
Hi NOPO,

As i could see, you are passing the entire line to the ToDateTime() function.

If the line have a string similar to a date time, the function converts it to the correct DateTime.

I am not sure what string you have in the line. If it contains variety of strings, parse it first and pass it to the Conversion function.

As from the microsoft documentation,some of the valid strings that could be converted are

dateString = "05/01/1996";
      ConvertToDateTime(dateString);
      //'05/01/1996' converts to 5/1/1996 12:00:00 AM Unspecified time.

dateString = "Tue Apr 28, 2009";
      ConvertToDateTime(dateString);
     // 'Tue Apr 28, 2009' converts to 4/28/2009 12:00:00 AM Unspecified time.

dateString = "Wed Apr 28, 2009";
      ConvertToDateTime(dateString);
    //   'Wed Apr 28, 2009' is not in the proper format.

dateString = "06 July 2008 7:32:47 AM";
      ConvertToDateTime(dateString);
    // '06 July 2008 7:32:47 AM' converts to 7/6/2008 7:32:47 AM Unspecified time.

dateString = "17:32:47.003";
      ConvertToDateTime(dateString);
      //'17:32:47.003' converts to 5/30/2008 5:32:47 PM Unspecified time.

dateString = "Sat, 10 May 2008 14:32:17 GMT";
      ConvertToDateTime(dateString);
   //'Sat, 10 May 2008 14:32:17 GMT' converts to 5/10/2008 7:32:17 AM Local time. 

dateString = "2009-05-01T07:54:59.9843750-04:00";
      ConvertToDateTime(dateString);
//    '2009-05-01T07:54:59.9843750-04:00' converts to 5/1/2009 4:54:59 AM Local time.



Wish you a good luck....

Have a Happy Coding.....

GeneralRe: How to read files using FolderBrowserDialog and save its contents into sql database table Pin
Nopo27-Mar-09 1:42
Nopo27-Mar-09 1:42 
GeneralRe: How to read files using FolderBrowserDialog and save its contents into sql database table Pin
King Julien27-Mar-09 3:48
King Julien27-Mar-09 3:48 
GeneralRe: How to read files using FolderBrowserDialog and save its contents into sql database table Pin
0x3c027-Mar-09 4:39
0x3c027-Mar-09 4:39 
AnswerRe: How to read files using FolderBrowserDialog and save its contents into sql database table Pin
Giorgi Dalakishvili26-Mar-09 22:38
mentorGiorgi Dalakishvili26-Mar-09 22:38 
QuestionCall event after closing my last form but not the main form? Pin
lixid26-Mar-09 19:02
lixid26-Mar-09 19:02 
AnswerRe: Call event after closing my last form but not the main form? Pin
King Julien26-Mar-09 19:35
King Julien26-Mar-09 19:35 
GeneralRe: Call event after closing my last form but not the main form? Pin
lixid26-Mar-09 19:56
lixid26-Mar-09 19:56 
GeneralRe: Call event after closing my last form but not the main form? Pin
King Julien26-Mar-09 20:18
King Julien26-Mar-09 20:18 
GeneralRe: Call event after closing my last form but not the main form? Pin
lixid27-Mar-09 20:09
lixid27-Mar-09 20:09 
QuestionNeed help with some basic problems Pin
RogerLum26-Mar-09 17:37
RogerLum26-Mar-09 17:37 
AnswerRe: Need help with some basic problems Pin
Dave Kreskowiak26-Mar-09 18:14
mveDave Kreskowiak26-Mar-09 18:14 
GeneralRe: Need help with some basic problems Pin
RogerLum26-Mar-09 19:10
RogerLum26-Mar-09 19:10 
GeneralRe: Need help with some basic problems Pin
King Julien26-Mar-09 19:39
King Julien26-Mar-09 19:39 
GeneralRe: Need help with some basic problems Pin
Tom Deketelaere26-Mar-09 22:31
professionalTom Deketelaere26-Mar-09 22:31 
GeneralRe: Need help with some basic problems Pin
Dave Kreskowiak27-Mar-09 1:26
mveDave Kreskowiak27-Mar-09 1:26 
AnswerRe: Need help with some basic problems Pin
12Code26-Mar-09 19:41
12Code26-Mar-09 19:41 
GeneralRe: Need help with some basic problems Pin
RogerLum26-Mar-09 20:07
RogerLum26-Mar-09 20:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.