private void LoadData() { #region Getting Systems try { connection.Open(); DataSet ds = new DataSet(); SqlCommand command = new SqlCommand("sp_GetSystemsForStore", connection); command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@p_UserSys", Convert.ToInt32(Session["UserSys"].ToString())); SqlDataAdapter dA = new SqlDataAdapter(command); dA.Fill(ds); RequestTo.DataSource = ds.Tables[0]; RequestTo.DataTextField = "SystemName"; RequestTo.DataValueField = "SystemID"; RequestTo.DataBind(); if (RequestTo != null) { RequestTo.Items.Insert(0, "Select System"); RequestTo.SelectedIndex = 0; } } catch (Exception ex) { } finally { connection.Close(); } #endregion }
public void PopulateDropDownVendor(String Text) { #region Populating Vendor Name Dropdown try { connection.Open(); Text = Text + "%"; SqlCommand command = new SqlCommand("Select * From tblVendor Where tblVendor.SupName LIKE '" + Text + "'", connection); DataSet ds = new DataSet(); SqlDataAdapter sA = new SqlDataAdapter(command); sA.Fill(ds); if (RequestTo.DataSource != null) { RequestTo.DataSource = null; } ProductSet = null; ProductSet = ds; RequestTo.DataSource = ds.Tables[0]; RequestTo.DataTextField = "SupName"; RequestTo.DataValueField = "SuppID"; RequestTo.DataBind(); if (RequestTo != null) { RequestTo.Items.Insert(0, "Select Vendor"); RequestTo.SelectedIndex = 0; } } catch (Exception ex) { } finally { connection.Close(); } #endregion }
private void LoadData() { #region Getting Vendors try { connection.Open(); DataSet ds = new DataSet(); SqlCommand command = new SqlCommand("Sp_GetVendor", connection); command.CommandType = CommandType.StoredProcedure; SqlDataAdapter dA = new SqlDataAdapter(command); dA.Fill(ds); RequestTo.DataSource = ds.Tables[0]; RequestTo.DataTextField = "SupName"; RequestTo.DataValueField = "SuppID"; RequestTo.DataBind(); if (RequestTo != null) { RequestTo.Items.Insert(0, "Select Vendor"); RequestTo.SelectedIndex = 0; } } catch (Exception ex) { } finally { connection.Close(); } #endregion #region Populating Product List //try //{ // connection.Open(); // SqlCommand command = new SqlCommand("Select Top 200 Product_Name,ProductID From tbl_ProductMaster Where tbl_ProductMaster.Product_Id_Org LIKE '444%' AND Status = 1", connection); // DataSet ds = new DataSet(); // SqlDataAdapter sA = new SqlDataAdapter(command); // sA.Fill(ds); // ProductSet = ds; // SelectProduct.DataSource = ds.Tables[0]; // SelectProduct.DataTextField = "Product_Name"; // SelectProduct.DataValueField = "ProductID"; // SelectProduct.DataBind(); // if (SelectProduct != null) // { // SelectProduct.Items.Insert(0, "Select Product"); // SelectProduct.SelectedIndex = 0; // } //} //catch (Exception ex) //{ //} //finally //{ // connection.Close(); //} #endregion }