Hi,
I have three check boxes inserted on an application form on a webpage in ASP.Net with the following text values;
CheckBox 1: "0 - 49 Employees"
CheckBox 2: "50 - 149 Employees"
CheckBox 3: "150 and more Employees"
The user is to select one of the 03 checkBoxes and the selected text value in the selected checkBox is to be transfered to the SQL data table (table name: "CompanyDetails").
I have performed many Google searches on this topic but all I find is checkBoxes from a userForm to a dataBase and this code does not work with ASP.Net.
Could someone help or point me in the right direction as to how do I get the checkBox text value from the ASP.Net webpage to my MS SQL data table?
Apologies if my programing terminolgy is not correct as I am very new to programing.
Regards,
Kyle

Jeeva SubburajRank #720 · 3.3K reputationPosted Mar 14, 2019, 4:25 AM EDT
Jignesh KumarRank #91 · 22.9K reputationPosted Mar 14, 2019, 5:05 AM EDT
Kyle Oliver68 reputationPosted Mar 14, 2019, 8:00 AM EDT
Kyle Oliver68 reputationPosted Mar 14, 2019, 8:04 AM EDT
protected void Page_Load(object sender, EventArgs e)
{
}
protected void BtnEmployerDetailsUpdate_Click(object sender, EventArgs e)
{
//Code to update CompanyDetails table
con.Open();
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "insert into CompanyDetails values('"+TxBoxTradeName.Text+ "','"+TxBoxDTIname.Text+ "','"+CheckBox1.Text+ "','"+CheckBox2.Text+ "','"+CheckBox3.Text+ "','"+TxBoxEEnumber.Text+ "')";
cmd.ExecuteNonQuery();
con.Close();
}
Jignesh KumarRank #91 · 22.9K reputationPosted Mar 14, 2019, 8:47 AM EDT
Jeeva SubburajRank #720 · 3.3K reputationPosted Mar 14, 2019, 9:09 AM EDT
Kyle Oliver68 reputationPosted Mar 15, 2019, 2:35 AM EDT
Jignesh KumarRank #91 · 22.9K reputationPosted Mar 15, 2019, 2:41 AM EDT