Jagjit Saini

Jagjit Saini

  • NA
  • 166
  • 0

Error

Jul 20 2011 8:39 AM
Hi

protected void lstcountry_SelectedIndexChanged(object sender, EventArgs e)
    {
        string qry = "select * from tbl_location where countrycode = " + lstcountry.SelectedValue;
        SqlDataAdapter da = new SqlDataAdapter(qry, ConfigurationManager.ConnectionStrings["cn"].ConnectionString);
        DataSet ds = new DataSet();
        da.Fill(ds);
        grdlocation.DataSource = ds;
        grdlocation.DataBind();
    }

It is giving error  "Incorrect Syntax near = "

Thanks

Answers (1)