String was not recognized as a valid DateTime

A

Andres Bohren

Hi i have a GridView and have Problems to put the values into the
right Datatypes.

Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles
GridView1.RowUpdating
Dim intID As Integer =
GridView1.DataKeys(e.RowIndex).Value.ToString()
Dim strDatum As String =
GridView1.Rows(e.RowIndex).Cells(2).Text
Dim pMessage As String =
GridView1.Rows(e.RowIndex).Cells(3).Text
Dim strZitat As String =
GridView1.Rows(e.RowIndex).Cells(4).Text

'When i try to convert the Strings into the correct Datatypes i get
the error "String was not recognized as a valid DateTime"
Dim pDatum As Date = Date.parse(strStatum)
Dim pZitat As Boolean = Boolean.Parse(strZitat)

'Same Result here "String was not recognized as a valid DateTime"
Dim pDatum As Date = Date.Parse(strDatum)
Dim pZitat As Boolean = Boolean.Parse(strZitat)

***********************************************************************
lbldebug.Text = "ID: " & intID & "<br>" & "Datum: " & strDatum &
"<br>" & "Message: " & pMessage & "<br>" & "Zitat: " & strZitat

ID: 1183
Datum: 02.01.2008
Message: This is my message
Zitat: True
***********************************************************************

What's wrong here?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top