Click here to Skip to main content
15,885,760 members
Home / Discussions / ASP.NET
   

ASP.NET

 
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 
GeneralRe: Suggesion Pin
mbb0111-Oct-16 4:12
mbb0111-Oct-16 4:12 
QuestionHow to adjust multiple textboxes in a row with browser window size Pin
Bootzilla336-Oct-16 12:35
Bootzilla336-Oct-16 12:35 
AnswerRe: How to adjust multiple textboxes in a row with browser window size Pin
Richard Deeming7-Oct-16 2:00
mveRichard Deeming7-Oct-16 2:00 
GeneralRe: How to adjust multiple textboxes in a row with browser window size Pin
Bootzilla3310-Oct-16 10:16
Bootzilla3310-Oct-16 10:16 
QuestionLog all request of Web API 2 (DelegatingHandler vs ActionFilterAttribute) Pin
Bastien Vandamme5-Oct-16 16:11
Bastien Vandamme5-Oct-16 16:11 
AnswerRe: Log all request of Web API 2 (DelegatingHandler vs ActionFilterAttribute) Pin
Richard Deeming6-Oct-16 4:29
mveRichard Deeming6-Oct-16 4:29 
QuestionHow to design data entry web app (C# VS 2015) Pin
Verdlin5-Oct-16 6:23
Verdlin5-Oct-16 6:23 
AnswerRe: How to design data entry web app (C# VS 2015) Pin
David Mujica5-Oct-16 10:30
David Mujica5-Oct-16 10:30 
GeneralRe: How to design data entry web app (C# VS 2015) Pin
Verdlin6-Oct-16 4:39
Verdlin6-Oct-16 4:39 
AnswerRe: How to design data entry web app (C# VS 2015) Pin
Nathan Minier6-Oct-16 1:17
professionalNathan Minier6-Oct-16 1:17 
GeneralRe: How to design data entry web app (C# VS 2015) Pin
Verdlin6-Oct-16 4:41
Verdlin6-Oct-16 4:41 
AnswerRe: How to design data entry web app (C# VS 2015) Pin
kmoorevs23-Oct-16 6:36
kmoorevs23-Oct-16 6:36 

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.