Quantcast
Channel: CodeProject Latest postings for ASP.NET
Viewing all articles
Browse latest Browse all 3938

Need help on how to insert yes/no toggle switch value into Sql table

$
0
0
I have a yes/no toggle input switch below:

<inputclass="checked-switch"id="lookup"name="lookup"type="checkbox"/><spanclass="text-switch"data-yes="yes"data-no="no"></span><spanclass="toggle-btn"></span>

and I'm not sure what value to put for it when insert that value into a sql table. Here is my insert statement:

sql = "INSERT INTO CONTRACTOR (CAGE_CODE_EXIST,_ADDRESS1, PRIME_CONTRACTOR_ADDRESS2, CONTRACTOR_CITY, CONTRACTOR_STATE, CONTRACTOR_POSTAL_CODE) " +
                      "VALUES ('" + lookup.Checked. + "', '" + addr1.Text + "','" + addr2.Text + "', '" + city.Text + "','" + state.Text + "','" + postalcode.Text + "');";

the lookup.Checked doesn't seem to work so what can I put in for the toggle switch?

Viewing all articles
Browse latest Browse all 3938

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>