Click here to Skip to main content
15,920,217 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionAnyone know how to create or seen a toggle switch with two big word/many letter selections Pin
Bootzilla3316-Oct-16 15:15
Bootzilla3316-Oct-16 15:15 
AnswerRe: Anyone know how to create or seen a toggle switch with two big word/many letter selections Pin
Richard Deeming17-Oct-16 1:52
mveRichard Deeming17-Oct-16 1:52 
Questionweb form generate html on separate pages Pin
dcof16-Oct-16 9:08
dcof16-Oct-16 9:08 
AnswerRe: web form generate html on separate pages Pin
ZurdoDev17-Oct-16 8:24
professionalZurdoDev17-Oct-16 8:24 
AnswerRe: web form generate html on separate pages Pin
ZurdoDev17-Oct-16 8:25
professionalZurdoDev17-Oct-16 8:25 
QuestionLinkhub Pin
Member 1279506215-Oct-16 2:40
Member 1279506215-Oct-16 2:40 
AnswerRe: Linkhub Pin
Richard MacCutchan15-Oct-16 6:19
mveRichard MacCutchan15-Oct-16 6:19 
Questionhow to send autogenerated sms to the number given by the user Pin
Member 1279468314-Oct-16 20:39
Member 1279468314-Oct-16 20:39 
AnswerRe: how to send autogenerated sms to the number given by the user Pin
Ovie Prince Tegaton15-Oct-16 6:03
professionalOvie Prince Tegaton15-Oct-16 6:03 
QuestionBioPlugIn ActxControl Pin
Sampat Kamble13-Oct-16 2:11
Sampat Kamble13-Oct-16 2:11 
AnswerRe: BioPlugIn ActxControl Pin
Richard MacCutchan13-Oct-16 5:58
mveRichard MacCutchan13-Oct-16 5:58 
GeneralRe: BioPlugIn ActxControl Pin
Mycroft Holmes13-Oct-16 14:59
professionalMycroft Holmes13-Oct-16 14:59 
QuestionKendo Grid Issues Pin
eejaynic12-Oct-16 11:29
eejaynic12-Oct-16 11:29 
AnswerRe: Kendo Grid Issues Pin
Vincent Maverick Durano17-Oct-16 9:12
professionalVincent Maverick Durano17-Oct-16 9:12 
QuestionRead xml string Pin
trungysp198610-Oct-16 14:36
trungysp198610-Oct-16 14:36 
AnswerRe: Read xml string Pin
Richard MacCutchan10-Oct-16 21:59
mveRichard MacCutchan10-Oct-16 21:59 
QuestionNeed help on how to insert yes/no toggle switch value into Sql table Pin
Bootzilla3310-Oct-16 10:17
Bootzilla3310-Oct-16 10:17 
SuggestionRe: Need help on how to insert yes/no toggle switch value into Sql table Pin
Richard MacCutchan10-Oct-16 22:00
mveRichard MacCutchan10-Oct-16 22:00 
AnswerRe: Need help on how to insert yes/no toggle switch value into Sql table Pin
Mycroft Holmes10-Oct-16 22:57
professionalMycroft Holmes10-Oct-16 22:57 
AnswerRe: Need help on how to insert yes/no toggle switch value into Sql table Pin
Richard Deeming11-Oct-16 2:21
mveRichard Deeming11-Oct-16 2:21 
Everything you wanted to know about SQL injection (but were afraid to ask) | Troy Hunt[^]
How can I explain SQL injection without technical jargon? | Information Security Stack Exchange[^]
Query Parameterization Cheat Sheet | OWASP[^]

C#
const string sql = "INSERT INTO CONTRACTOR (CAGE_CODE_EXIST, PRIME_CONTRACTOR_ADDRESS1, PRIME_CONTRACTOR_ADDRESS2, CONTRACTOR_CITY, CONTRACTOR_STATE, CONTRACTOR_POSTAL_CODE)"
                 + " VALUES (@CAGE_CODE_EXIST, @PRIME_CONTRACTOR_ADDRESS1, @PRIME_CONTRACTOR_ADDRESS2, @CONTRACTOR_CITY, @CONTRACTOR_STATE, @CONTRACTOR_POSTAL_CODE)";

string connectionString = WebConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;

using (var connection = new SqlConnection(connectionString))
using (var command = new SqlCommand(sql, connection))
{
    command.Parameters.AddWithValue("@CAGE_CODE_EXIST", lookup.Checked);
    command.Parameters.AddWithValue("@PRIME_CONTRACTOR_ADDRESS1", addr1.Text);
    command.Parameters.AddWithValue("@PRIME_CONTRACTOR_ADDRESS2", addr2.Text);
    command.Parameters.AddWithValue("@CONTRACTOR_CITY", city.Text);
    command.Parameters.AddWithValue("@CONTRACTOR_STATE", state.Text);
    command.Parameters.AddWithValue("@CONTRACTOR_POSTAL_CODE", postalcode.Text);
    
    connection.Open();
    command.ExecuteNonQuery();
}




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


AnswerRe: Need help on how to insert yes/no toggle switch value into Sql table Pin
ZurdoDev11-Oct-16 3:21
professionalZurdoDev11-Oct-16 3:21 
SuggestionSuggesion Pin
Zarak Ali7-Oct-16 22:27
Zarak Ali7-Oct-16 22:27 
GeneralRe: Suggesion Pin
Afzaal Ahmad Zeeshan7-Oct-16 23:43
professionalAfzaal Ahmad Zeeshan7-Oct-16 23:43 
GeneralRe: Suggesion Pin
Richard MacCutchan8-Oct-16 2:39
mveRichard MacCutchan8-Oct-16 2:39 
AnswerRe: Suggesion Pin
ZurdoDev10-Oct-16 9:48
professionalZurdoDev10-Oct-16 9:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.