|
-
Apr 1st, 2014, 07:31 AM
#1
Thread Starter
New Member
Facing issue in Date format (string was not recognized as a valid datetime in vb.net)
Hi There,
i am facing issue in date format. please help me to fix this.
this below content is the raw data and i am pulling that from csv file
---------------------------------------------------------------------------------------------------
Incident ID Title Status Open Time
IM17911585 IPG:NA Status Of Order 24IH42151001 (SBB2486382) Open 3/27/2014 9:10
---------------------------------------------------------------------------------------------------
Dim opentime As DateTime ' = Nothing ' open Date
Dim tmpArray() As String = Regex.Split(hpsm, ",")
If tmpArray(0) = "" Then
Exit While
End If
id = Trim(tmpArray(0))
title = tmpArray(1)
status = tmpArray(2)
opentime = DateTime.Parse(tmpArray(3))
When i run the program the open time is showing error and it is not picking the format correctly. please refer the below error.
Database Error: System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at System.DateTime.Parse(String s)
Please help me to fix this.
Tags for this Thread
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
|