R
RosH
I cannot understand what is wrong with the following code. All I want
to do is to change certain values of a DateTime column during FormView
updating event. Right now this event handler returns Null values to
the Database. Looking for expert advice.
Protected Sub FormView1_ItemUpdating(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.FormViewUpdatedEventArgs) Handles
FormView1.ItemUpdated
Dim PassOutYearDDL As DropDownList =
FormView1.FindControl("PassOutYearDDL")
Dim PassOutDate1 As DateTime =
DateTime.ParseExact(PassOutYearDDL.SelectedValue.ToString, "yyyy",
Nothing)
e.NewValues.Remove("PassOutYear")
e.NewValues.Add("PassOutYear", PassOutDate1.ToString)
End Sub
to do is to change certain values of a DateTime column during FormView
updating event. Right now this event handler returns Null values to
the Database. Looking for expert advice.
Protected Sub FormView1_ItemUpdating(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.FormViewUpdatedEventArgs) Handles
FormView1.ItemUpdated
Dim PassOutYearDDL As DropDownList =
FormView1.FindControl("PassOutYearDDL")
Dim PassOutDate1 As DateTime =
DateTime.ParseExact(PassOutYearDDL.SelectedValue.ToString, "yyyy",
Nothing)
e.NewValues.Remove("PassOutYear")
e.NewValues.Add("PassOutYear", PassOutDate1.ToString)
End Sub