protected void btnSubmit_Click(object sender, EventArgs e) { try { if (ddlCity.SelectedIndex != 0 && ddlAgency.SelectedIndex != 0) { objAdmin.CityId = Convert.ToInt32(ddlCity.SelectedItem.Value); objAdmin.AgencyName = ddlAgency.SelectedItem.Text; DataSet ds = objAdmin.DispalyCylinderStatus(); if (ds.Tables[0].Rows.Count > 0) { gvCylinders.Visible = true; gvCylinders.DataSource = ds.Tables[0]; gvCylinders.DataBind(); } else { gvCylinders.Visible = true; gvCylinders.EmptyDataText = "No Data Available"; gvCylinders.DataBind(); } } } catch (Exception ex) { } }