Question: Modify the following code to prevent SQL injection and cross site scripting (XSS) attack: Protected void GetProductsButton_Click(object sender.EventArgs e) { SqlCommand cmd = new SqlCommand(Select
Modify the following code to prevent SQL injection and cross site scripting (XSS) attack:
Protected void GetProductsButton_Click(object sender.EventArgs e)
{
SqlCommand cmd = new SqlCommand(Select * from product where ProductName like +txtProductName .Text + % .connection)
Con.Open();
ProductsGridView.DataSource = cmd.ExcuteReader();
ProductsGridView.DataBind();
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
