protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string sqlConnString = ConfigurationManager.ConnectionStrings["ConnString"].ToString(); SqlConnection sqlConn = new SqlConnection(sqlConnString); sqlConn.Open(); SqlCommand sqlCmd = new SqlCommand("select distinct provider_city from ambulance_provider order by provider_city", sqlConn); SqlDataAdapter da = new SqlDataAdapter(sqlCmd); DataSet ds = new DataSet(); da.Fill(ds); LocationList.DataTextField = ds.Tables[0].Columns["provider_city"].ToString(); LocationList.DataValueField = ds.Tables[0].Columns["provider_city"].ToString(); LocationList.DataSource = ds.Tables[0]; LocationList.DataBind(); //LocationList.SelectedIndex = 1; SqlCommand sqlCmd2 = new SqlCommand("select * from ambulance_provider order by provider_name", sqlConn); SqlDataAdapter da2 = new SqlDataAdapter(sqlCmd2); DataSet ds2 = new DataSet(); da2.Fill(ds2); ProviderList.DataTextField = ds2.Tables[0].Columns["provider_name"].ToString(); ProviderList.DataValueField = ds2.Tables[0].Columns["provider_id"].ToString(); ProviderList.DataSource = ds2.Tables[0]; ProviderList.DataBind(); sqlConn.Close(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ProviderList.DataSource = LoadGateways(); ProviderList.DataBind(); } }
protected void Get_Provider(object sender, EventArgs e) { DropDownList s = sender as DropDownList; string location = s.SelectedValue; string sqlConnString = ConfigurationManager.ConnectionStrings["ConnString"].ToString(); SqlConnection sqlConn = new SqlConnection(sqlConnString); sqlConn.Open(); String sql = "select * from ambulance_provider where provider_city = '" + location + " ' order by provider_name"; SqlCommand sqlCmd = new SqlCommand(sql, sqlConn); SqlDataAdapter da = new SqlDataAdapter(sqlCmd); DataSet ds = new DataSet(); da.Fill(ds); ProviderList.DataTextField = ds.Tables[0].Columns["provider_name"].ToString(); ProviderList.DataValueField = ds.Tables[0].Columns["provider_id"].ToString(); ProviderList.DataSource = ds.Tables[0]; ProviderList.DataBind(); sqlConn.Close(); }
protected void Page_Load(object sender, EventArgs e) { ProviderList.DataSource = Providers.GetProviders(); ProviderList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { ProviderList.DataSource = SharpMap.Utilities.Providers.GetProviders(); ProviderList.DataBind(); }