pooja nirmalkar

pooja nirmalkar

  • NA
  • 22
  • 7.5k

error in C# code : Must declare the scalar variable image

Nov 26 2015 3:04 AM
{
string image_name = "";
SqlCommand cmd1 = new SqlCommand("Select Image from Slider_Data where Section=@Section", con);
cmd1.Parameters.AddWithValue("@Section", ddlsection.SelectedValue);
con.Open();
SqlDataReader dr = cmd1.ExecuteReader();
if (dr.Read())
{
image_name = dr["Image"].ToString();
}
cmd1.Parameters.AddWithValue("@Image", image_name);
con.Close();
}
cmd.Parameters.AddWithValue("@Description",CKEditorControl.Text);
con.Open();
int i = cmd.ExecuteNonQuery();
if (i == 1)
{
Response.Write("<script>('Updated Successfully')</script>");
}
con.Close();
}
}
catch(Exception ex)
{
Response.Write(ex.Message);
}

Answers (10)