Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 179781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:28:05+00:00 2026-05-11T14:28:05+00:00

I have created a small survey web page on our company Intranet. This web

  • 0

I have created a small survey web page on our company Intranet. This web page is not accessible from the outside.

The form is simply a couple of radio buttons and a comments box.

I would like to maintain good coding practices and would like to guard against SQL Injections.

Can SQL injections happen on a insert statement with comments from the textbox? If so, how can I guard against it using .NET 2.0?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T14:28:06+00:00Added an answer on May 11, 2026 at 2:28 pm

    Injection can happen on any SQL statement not run properly.

    For example, let’s pretend your comment table has two fields, an integer ID and the comment string. So you’d INSERT as follows:

     INSERT INTO COMMENTS VALUES(122,'I like this website'); 

    Consider someone entering the following comment:

    '); DELETE FROM users; -- 

    If you just put the comment string into the SQL without any processesing this could turn your single INSERT in to the following two statements followed by a comment:

    INSERT INTO COMMENTS VALUES(123,''); DELETE FROM users; -- '); 

    This would delete everything from your users table. And there are people willing to spend all day finding the right tablename to empty using trial and error and various tricks. Here’s a description of how you could perform an SQL Injection attack.

    You need to use parameterized SQL statements to prevent this.

    And this isn’t just for security reasons. For example, if you’re creating your SQL statements naively the following comment:

    I'm just loving this website 

    would cause an SQL syntax error because of the apostrophe being interpreted by SQL as a closing quote.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a small database (couchdb) and web page (html5 boilerplate). My end
I have created a small PSD Mockup of a about page for my website.
I have created a small KineticJS animation, which you can see at this address:
I have created a small app which I have not used any .entitlement file
As part of our intended migration from Linq2Sql to Entity Framework, we have created
I have created small test web application which makes use of LINQ to SQL.
I have created a small app to try and accomplish this but I am
I have created a small test page using Sencha Touch , OpenLayers and I
I have created a small div on top of the page that contains a
I have created a small web application in java. And now I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.