Click here to Skip to main content
15,881,812 members
Articles / Programming Languages / C#

Preventing SQL Injection in ADO.NET

Rate me:
Please Sign up or sign in to vote.
4.57/5 (4 votes)
12 Nov 2012CPOL4 min read 39.5K   233   8  
This article is to help beginners understand what is SQL injection and how to prevent it
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SampleHacking
{
    public partial class Redirected : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            label.Text = "Welcome to our website "+" "+(string)Session["user"];
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Junior) Aspire Systems
India India
Just Started Software development( kind of a kiddo for most software giants here)... Exploring a lot in .NET technology..Want to be a future geek.. so here Smile | :)

Comments and Discussions