asp.net - How to resolve the error "String was not recognized as a valid Date Time in Vb.net " -
my code behind follows want enter date per displayed on textbox4 front end
protected sub btnsave_click1(byval sender object, byval e eventargs) handles button2.click dim dt2 oledbparameter dt2 = cmd.createparameter dt2.oledbtype = oledbtype.date dim dt string = textbox4.innertext dt2.value = datetime.parseexact(dt,"m/dd/yyyy", nothing) dt2.parametername = "@startdate" cmd.parameters.add(dt2) end sub
my front end code in aspx follows
<div class="container" id="textbox4" runat="server" width="181px" bordercolor="black" borderstyle="solid"> <div class="row"> <div class='col-sm-6'> <div class="form-group"> <div class='input-group date' id='datetimepicker1'> <input type='text' class="form-control" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> </div> <script type="text/javascript"> $(function () { $('#datetimepicker1').datetimepicker(); }); </script> </div> </div>
protected sub btnsave_click1(byval sender object, byval e eventargs) handles button2.click dim dt2 oledbparameter dt2 = cmd.createparameter dt2.oledbtype = oledbtype.date dt2.value = = textbox4.text dt2.parametername = "@startdate" cmd.parameters.add(dt2)
end sub
edited , works feedback , help.
Comments
Post a Comment