Question
asp.net, c# I have only one checkbox, and I want to keep NULL to the SQL server until the user checks the checkbox then change
asp.net, c#
I have only one checkbox, and I want to keep NULL to the SQL server until the user checks the checkbox then change a Null to the 1, which is check, and 0 which is unchecked.
how can I do that?
this is my code from asp.net
and c# code:
if (lblMandatoryAppearance.Checked.Equals(-1)) { lgl_eve.MandatoryAppearance.Equals(0); } else { lgl_eve.MandatoryAppearance = Convert.ToBoolean(lblMandatoryAppearance.Checked); }
I have column in SQL and I want if the user open the web.aspx so many times and do not click on the checkbox, keep it as NULL in the SQL, and any time user open the web.aspx and click on the checkbox, change the value in SQL to 1 which means selected and if user unchecked the checkbox make it to 0 in SQL which is unchecked
in fact, I want to be null as long as a user do not click on the checkbox.
how can I do that, please help.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started