Date Conversion Problem
-
Hi, Public MasterDispDt As String Public Sub ExFunction() MasterDispDt = DtlsDs.Tables("DtlsTab").Rows(r).Item("DispDate").ToString End Sub TxtDispDate is a Textbox, Calender Selected value assigned to it. Dim TDate As Date = CDate(Trim(txtDespDate.Text)) Dim MDate As Date = CDate(Trim(MasterDispDt)) If TDate < MDate Then 'Some Code Endif TxtDispDate I selected as '28-04-2009' The above Code giving Error : Error : Conversion from string "28-04-2009" to type 'Date' is not valid. Pl. Help me out Ramesh Sambari
-
Hi, Public MasterDispDt As String Public Sub ExFunction() MasterDispDt = DtlsDs.Tables("DtlsTab").Rows(r).Item("DispDate").ToString End Sub TxtDispDate is a Textbox, Calender Selected value assigned to it. Dim TDate As Date = CDate(Trim(txtDespDate.Text)) Dim MDate As Date = CDate(Trim(MasterDispDt)) If TDate < MDate Then 'Some Code Endif TxtDispDate I selected as '28-04-2009' The above Code giving Error : Error : Conversion from string "28-04-2009" to type 'Date' is not valid. Pl. Help me out Ramesh Sambari
-
this problem can be beacuase of date format. try other formats like "MM/dd/yyyy" and apply break and check the result.
Hi, When I run from Source Code, there is no problem. it is working fine. Even i run without debugging, that time also its fine. When I publish it to a folder and open , then the problem is coming. Ramesh Sambari
-
Hi, When I run from Source Code, there is no problem. it is working fine. Even i run without debugging, that time also its fine. When I publish it to a folder and open , then the problem is coming. Ramesh Sambari
-
Hi, Public MasterDispDt As String Public Sub ExFunction() MasterDispDt = DtlsDs.Tables("DtlsTab").Rows(r).Item("DispDate").ToString End Sub TxtDispDate is a Textbox, Calender Selected value assigned to it. Dim TDate As Date = CDate(Trim(txtDespDate.Text)) Dim MDate As Date = CDate(Trim(MasterDispDt)) If TDate < MDate Then 'Some Code Endif TxtDispDate I selected as '28-04-2009' The above Code giving Error : Error : Conversion from string "28-04-2009" to type 'Date' is not valid. Pl. Help me out Ramesh Sambari