I have one checkbox control in my web application.And i Connected with the sql server.I declared checkbox datatype as bit. when i am checked the checkbox control it needs to pass bit value.I already execute by following method.
int active;
if (chkboxActive.Checked)
{ active = 1; }
else
{ active = 0; }
cmd.Parameters.Add("@active", SqlDbType.Bit).Value = active;
It executes well.But i felt it is not a efficient one. Give any other easiest code in short line.
cmd.Parameters.Add("@active", SqlDbType.Bit).Value = chkboxActive.Checked;Checked.