Concerning your article on sql injection

Last post 05-13-2008 9:35 AM by McGuire. 4 replies.

Sort Posts:

  • Concerning your article on sql injection

    05-09-2008, 2:11 PM
    • Loading...
    • McGuire
    • Joined on 01-25-2007, 4:47 PM
    • Posts 50

    You have code related to all versions except ASP.NET 3.5 ...

    Will the code for 2.0 work for it?

    Thanks.

  • Re: Concerning your article on sql injection

    05-09-2008, 2:42 PM
    Answer
    • Loading...
    • AceCorban
    • Joined on 08-23-2007, 3:43 PM
    • Monterey, CA
    • Posts 484

    I'd be interested in seeing this article.  Since I haven't read it, I can't be too sure, but as far as I know, the biggest defense against SQL Injection is the use of named parameters:

     

    queryString = "SELECT password FROM Users WHERE username=@username";
    command = new SqlCommand(queryString, connection);
    command.Parameters.Add("@id", usernameTB.Text);
    password = Convert.ToString(command.ExecuteScalar());
     I don't believe this has changed in version 3.5.  Were there any other defenses discussed?  Could you post a link to the article?
    I never lose, some people are just better than me at winning.
  • Re: Concerning your article on sql injection

    05-09-2008, 3:11 PM
    • Loading...
    • McGuire
    • Joined on 01-25-2007, 4:47 PM
    • Posts 50

    The article is at:  http://forums.asp.net/t/1254125.aspx

     

  • Re: Concerning your article on sql injection

    05-13-2008, 3:51 AM
    Answer

    McGuire:

    Will the code for 2.0 work for it?

     

    Hi

    The source code for v2.0 should also work in v3.5 environment

    Best Regards
    XiaoYong Dai
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
  • Re: Concerning your article on sql injection

    05-13-2008, 9:35 AM
    • Loading...
    • McGuire
    • Joined on 01-25-2007, 4:47 PM
    • Posts 50

    Thank you for your help.  Smile

Page 1 of 1 (5 items)