Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,

I am working in Web application. I am having controls to enter Start time and End time in text boxes, I used ajax:Masked edit extender for validation ,
My issue is in scenario1,
I have entered value say 11:12 in Start hours and I press tab, the focus will be in End field. Now am saving value in database that time value saving like this --:--
How to slove this issue , Please give any solution.

Issue: in database value saving --:--

o/p I need: if i save empty data in database i need to save null value

Follwing is my code,
XML
  <asp:TextBox ID="txtReturnArrivalTime" CssClass="form-control form-control-width"    MaxLength="50" runat="server" />

<ajaxtoolkit:MaskedEditExtender ID="MaskedEditExtender4" runat="server" Mask="99:99" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder=""
CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True"  AutoComplete="False"  MaskType="Time" TargetControlID="txtReturnArrivalTime">
 </ajaxtoolkit:MaskedEditExtender>



i am very needful to me.,please guide me ASAP.

Thanks&Regards,
Ramu,
Posted
Updated 22-Jun-15 21:28pm
v8

1 solution

Dear Ramu,

Check in code behind if you are getting --:-- then use
C#
DBNull.Value
it will save null in your table column.

Thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900