how to store checkbox data into database using sqlqueris in asp.net

Posted by Dhananjaya.Arisetti under ASP.NET on 5/2/2012 | Points: 10 | Views : 2424 | Status : [Member] | Replies : 1
hi,

how to store checkbox data into database using sqlqueris in asp.net




Responses

Posted by: Patil_Rakesh on: 5/2/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,
1. you must have bit field in table
2. while sending parameters to Store Proc,
use this code,

if (checkbox.Checked)
{
cmd.Parameters.AddWithValue("@value",1);
}
else
{
cmd.Parameters.AddWithValue("@value",0);
}

Dhananjaya.Arisetti, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response