You can try as bellow:
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
SqlCommand com1 = new SqlCommand("select sno,adv,city from adv1 where categry=@b",con);
com1.Parameters.AddWithValue("@b", DropDownList1.Text);
con.Open();
SqlDataAdapter da=new SqlDataAdapter(com1);
DataSet ds=new DataSet();
da.Fill(ds);
GridView1.DataSource = ds.Tables[0];
GridView1.DataBind();
con.Close();
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.AllowPaging = true;
}
Thanks,
Mamun