Hi,
You are passing inline parameter and command parameter at a time. You need to choose one of them, better choice is passing command parameter instead of inline value.
Please see the modified sql statement below,
string SQL = "SELECT * FROM DPSpdf WHERE intpdfId=@intpdfId";
SqlCommand myCommand = new SqlCommand(SQL, (SqlConnection)Application.Get("DPS"));
myCommand.Parameters.AddWithValue("@intpdfId", txtdanceid.Text);
SqlDataReader myReader = myCommand.ExecuteReader();
if (myReader.Read())
{
Response.ContentType = myReader["ContentType"].ToString();
Response.BinaryWrite((byte[])myReader["strpdfurl"]);
}
myReader.Close();
Response.End();