parameterized sql query - asp.net / c#

前端 未结 6 572
孤独总比滥情好
孤独总比滥情好 2021-01-18 20:03

So I recently learned that I should absolutely be using parametrized query\'s to avoid security issues such as SQL injection. That\'s all fine and all, I got it working.

6条回答
  •  深忆病人
    2021-01-18 20:36

    Use single line SqlParameterCollection.AddWithValue Method

    cmd.Parameters.AddWithValue("@username",username.Text);
    

提交回复
热议问题