private void showCache() { HttpContext oc = HttpContext.Current; List <string> foundCacheItems = new List <string>(); IDictionaryEnumerator en = oc.Cache.GetEnumerator(); while (en.MoveNext()) { if (en.Key.ToString().IndexOf("WebPages") == -1) { foundCacheItems.Add(en.Key.ToString()); DataGrid aa = new DataGrid(); aa.EnableViewState = false; aa.DataSource = en.Value; aa.DataBind(); Label lbl = new Label(); lbl.Text = "<h2>Cache content of: " + en.Key + "</h2>"; Page.Controls.Add(lbl); Page.Controls.Add(aa); } } BulletedList1.DataSource = foundCacheItems; BulletedList1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { //Usuario miusuario=new Usuario(); //miusuario.Login="******"; List <Usuario> usuarios = new List <Usuario>(); Usuario usr = new Usuario(); usr.Login = "******"; usr.Clave = "12345"; usuarios.Add(usr); usr = new Usuario(); usr.Login = "******"; usr.Clave = "99999"; usuarios.Add(usr); DropDownList1.DataSource = usuarios; DropDownList1.DataBind(); GridView1.DataSource = usuarios; GridView1.DataBind(); BulletedList1.DataSource = usuarios; BulletedList1.DataBind(); }
protected void Calendar1_SelectionChanged(object sender, EventArgs e) { foreach (DateTime selecteddate in Calendar1.SelectedDates) { submit1text.Text += selecteddate.ToString("MMM dd, yyyy") + "<br />"; } BulletedList1.DataSource = Calendar1.SelectedDates; BulletedList1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { XElement doc = XElement.Load(Server.MapPath("Instructions.xml")); var instructions = doc.Elements("Instructions"); var ds = from s in instructions select new { Instruction = s.Element("Instruction").Value }; BulletedList1.DataSource = ds; BulletedList1.DataTextField = "Instruction"; BulletedList1.DataValueField = "Instruction"; BulletedList1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { FirstClass1 afirst = new FirstClass1(); Listbox1.DataSource = afirst.arraymethods(); Listbox1.DataBind(); BulletedList1.DataSource = afirst.arraymethods(); BulletedList1.DataBind(); FirstClass1 asecond = new FirstClass1(3, "hello", 9.00, 'Z'); hello.Text = asecond.Firstmethodreturn(); }
protected void LoadLegende() { string _constr = System.Configuration.ConfigurationManager.ConnectionStrings["ApplicationDb"].ToString(); DAL.DAL _dal = new DAL.DAL(_constr, DAL.DAL.Moteurs.SQLSERVER.ToString()); if (_dal.IsConnexionFermee()) { //Ouverture de la connection _dal.OuvrirConnexion(); } string[] _param = new string[0]; DataTable _tbl_legende = _dal.GetInformationInDataTable("LoadLegende", CommandType.StoredProcedure, _param); _dal.FermeConnexion(); BulletedList1.DataSource = _tbl_legende; BulletedList1.DataBind(); }
protected void ChooseB_Click(object sender, EventArgs e) { var elem = from a in db.Employees where a.EmployeeType == RadioButtonList1.SelectedValue select new { Name = a.FirstName + " " + a.LastName, id = a.EmployeeID }; if (elem.Count() != 0) { BulletedList1.DataSource = elem; BulletedList1.DataTextField = "Name"; BulletedList1.DataValueField = "id"; BulletedList1.DataBind(); } for (int i = 0; i <= BulletedList1.Items.Count - 1; i++) { BulletedList1.Items[i].Value = "~/AdminFolder/EditUser.aspx?a=" + BulletedList1.Items[i].Value; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { UserDetails x = new UserDetails(); DataSet dSet = x.GetListOfAllUsers(); // writing to XML dSet.WriteXml(@"C:\Developer\DsetXMLFile.xml"); GridView1.DataSource = dSet; GridView1.DataBind(); BulletedList1.DataSource = dSet; BulletedList1.DataTextField = "UserName"; BulletedList1.DataValueField = "UserName"; BulletedList1.DataBind(); // Records not coming since it can only show only one column CheckBoxList1.DataSource = dSet; CheckBoxList1.DataTextField = "UserName"; CheckBoxList1.DataValueField = "UserName"; CheckBoxList1.DataBind(); DropDownList1.DataSource = dSet; DropDownList1.DataTextField = "UserName"; DropDownList1.DataValueField = "UserName"; DropDownList1.DataBind(); RadioButtonList1.DataSource = dSet; RadioButtonList1.DataTextField = "UserName"; RadioButtonList1.DataValueField = "UserName"; RadioButtonList1.DataBind(); ListBox1.DataSource = dSet; ListBox1.DataTextField = "UserName"; ListBox1.DataValueField = "UserName"; ListBox1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { { if (!IsPostBack) { var query = "SELECT Inventory.PART_NO " + Environment.NewLine + "FROM Inventory " + Environment.NewLine + "JOIN Location ON Location.PartID = Inventory.PartID " + Environment.NewLine + "WHERE PART_NO = '01A223000A21-11'"; string con = ConfigurationManager.ConnectionStrings["IMMSTest"].ConnectionString; SqlConnection connection = new SqlConnection(con); SqlDataAdapter da = new SqlDataAdapter(); DataSet ds = new DataSet(); try { using (connection) { connection.Open(); da = new SqlDataAdapter(query, connection); da.Fill(ds); connection.Close(); BulletedList1.DataSource = ds.Tables[0]; BulletedList1.DataBind(); } } catch (SqlException) { BulletedList1.DataSource = null; } } } }
protected void Page_Load(object sender, EventArgs e) { List <Usuario> usuarios = new List <Usuario>(); Usuario usr = new Usuario(); usr.NombreUsuario = "John"; usr.PassUsuario = "123456"; usuarios.Add(usr); usr = new Usuario(); usr.NombreUsuario = "Anna"; usr.PassUsuario = "654321"; usuarios.Add(usr); DropDownList1.DataSource = usuarios; DropDownList1.DataBind(); GridView1.DataSource = usuarios; GridView1.DataBind(); BulletedList1.DataSource = usuarios; BulletedList1.DataBind(); }
protected void Button3_Click(object sender, EventArgs e) { String parameter = RadioButtonList1.SelectedValue.ToString(); String prparam = TextBox7.Text; String sql = ""; if (parameter.Equals("By Product ID")) { sql = "Select Product_ID,CONCAT(Company_Name,' ',Product_Name,' ',Retail_Price) from Current_Store_Products where Product_ID='" + prparam + "' and Stock<>0"; } if (parameter.Equals("By Product Name")) { sql = "Select Product_ID,CONCAT(Company_Name,' ',Product_Name,' ',Retail_Price) from Current_Store_Products where Product_Name like'%" + prparam + "%' and Stock<>0"; } conn = new MySqlConnection(GetConnectionString()); try { conn.Open(); MySqlCommand comm = new MySqlCommand(sql, conn); MySqlDataReader dr = comm.ExecuteReader(); ComboProductsList.DataSource = dr; ComboProductsList.DataTextField = "CONCAT(Company_Name,' ',Product_Name,' ',Retail_Price)"; ComboProductsList.DataValueField = "Product_ID"; ComboProductsList.DataBind(); dr.Close(); } catch (Exception ex) { Response.Write("InButton3Click" + ex.Message); } finally { conn.Close(); } BulletedList1.DataSource = null; BulletedList1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { BLayer myBlayer = new BLayer(); SqlDataReader myDtr = myBlayer.get_dikaiologitika_pou_exei_proskomisei(); BulletedList1.DataSource = myDtr; BulletedList1.DataBind(); Oplitis myOplitis = myBlayer.get_Last_Inserted_Oplitis(); insertDate.Text = myOplitis.eggrafi.ToString(); asm.Text = myOplitis.asm.ToString(); rank.Text = myOplitis.bathmos.ToString(); fname.Text = myOplitis.onoma.ToString(); lname.Text = myOplitis.eponymo.ToString(); loxos.Text = myOplitis.loxos.ToString(); LabelKatigoria.Text = myOplitis.katigoria.ToString(); paratiriseis.Text = myOplitis.paratiriseis.ToString(); katalogisteo.Text = myOplitis.katalogisteo.ToString(); kratiseis.Text = myOplitis.kratiseis.ToString(); pliroteo.Text = myOplitis.pliroteo.ToString(); dx.Text = myOplitis.dXmas.ToString(); dp.Text = myOplitis.dPasxa.ToString(); fdm.Text = myOplitis.fdmDate.ToString(); }
protected void BulletedListDataBind() { SqlConnection conn = new SqlConnection("server=LAPTOP-MSQV6S42\\SQLEXPRESS;UID=sa;Password=123;Database=WebDisk"); conn.Open(); SqlCommand cmd = new SqlCommand("select courseid from courses", conn); SqlDataAdapter adapter = new SqlDataAdapter(cmd); DataSet res = new DataSet(); adapter.Fill(res); fullcourselist = new List <int>(); for (int i = 0; i < res.Tables[0].Rows.Count; ++i) { fullcourselist.Add(Convert.ToInt32(res.Tables[0].Rows[i][0].ToString())); } SqlCommand cmd1 = new SqlCommand("select courseid from enroll where userid = @UID", conn); cmd1.Parameters.Add("@UID", SqlDbType.Int).Value = Session["UID"]; adapter = new SqlDataAdapter(cmd1); DataSet res1 = new DataSet(); adapter.Fill(res1); enrolledcourselist = new List <int>(); notenrolledList = new List <int>(); for (int i = 0; i < res1.Tables[0].Rows.Count; ++i) { enrolledcourselist.Add(Convert.ToInt32(res1.Tables[0].Rows[i][0].ToString())); } for (int i = 0; i < fullcourselist.Count; ++i) { if (!enrolledcourselist.Contains(fullcourselist[i])) { notenrolledList.Add(fullcourselist[i]); } } notenrolledName = new List <string>(); SqlCommand cmd2 = new SqlCommand("select coursename from courses where courseid = @CID", conn); for (int i = 0; i < notenrolledList.Count; ++i) { cmd2.Parameters.Add("@CID", SqlDbType.Int).Value = notenrolledList[i]; adapter = new SqlDataAdapter(cmd2); DataSet res2 = new DataSet(); adapter.Fill(res2); notenrolledName.Add(res2.Tables[0].Rows[0][0].ToString()); cmd2.Parameters.Clear(); } BulletedList1.DataSource = notenrolledName; BulletedList1.DataBind(); }
protected void UpdateTimer_Tick(object sender, EventArgs e) { BulletedList1.DataBind(); }
protected void Button4_Click(object sender, EventArgs e) { conn = new MySqlConnection(GetConnectionString()); int quant = int.Parse(TextBox6.Text); List <String> productid = new List <String>(); String cbid = TextBox1.Text; double cprice = 0.0; BulletedList1.DataSource = null; BulletedList1.DataBind(); foreach (ListItem item in ComboProductsList.Items) { if (item.Selected) { productid.Add(item.Value.ToString()); } } try { conn.Open(); MySqlCommand comm = new MySqlCommand(); comm.Connection = conn; foreach (String prid in productid) { comm.CommandText = "Select count(*),CONCAT(t.Product_ID,' ',p.Company_Name,' ', p.Product_Name) from Transactions t,Current_Store_Products p where t.Bill_No in (Select Bill_No from Transactions where Product_ID = '" + prid + "') and t.Product_ID <> '" + prid + "' and t.Product_ID=p.Product_ID group by t.Product_ID order by count(*) desc LIMIT 0,3"; MySqlDataReader dr = comm.ExecuteReader(); BulletedList1.DataSource = dr; BulletedList1.DataTextField = "CONCAT(t.Product_ID,' ',p.Company_Name,' ', p.Product_Name)"; BulletedList1.DataBind(); dr.Close(); comm.CommandText = "Select Retail_Price from Current_Store_Products where Product_ID ='" + prid + "'"; dr = comm.ExecuteReader(); dr.Read(); cprice = quant * dr.GetDouble(0); //Label10.Text = cprice.ToString(); //TextBox2.Text = cprice.ToString(); dr.Close(); comm.CommandText = "Insert into Combopack_Schemes values ('" + cbid + "','" + prid + "'," + quant + "," + cprice + ")"; comm.ExecuteNonQuery(); comm.CommandText = "Select Sum(Quantity),Sum(Price) from Combopack_Schemes where Combo_ID='" + cbid + "'"; dr = comm.ExecuteReader(); dr.Read(); Label9.Text = dr.GetValue(0).ToString(); Label10.Text = dr.GetValue(1).ToString(); TextBox2.Text = dr.GetValue(1).ToString(); dr.Close(); } comm.CommandText = "Select p.Product_ID, p.Company_Name, p.Product_Name, c.Quantity from Current_Store_Products p,Combopack_Schemes c where c.Product_ID=p.Product_ID and c.Combo_ID='" + cbid + "'"; MySqlDataReader dr1 = comm.ExecuteReader(); GridView1.DataSource = dr1; GridView1.DataBind(); dr1.Close(); } catch (Exception ex) { Response.Write(ex.Message); } finally { conn.Close(); } }
protected void BulletedList1_Load(object sender, EventArgs e) { BulletedList(1); BulletedList1.DataSource = ptDetailList; BulletedList1.DataBind(); }
private void bindData() { BulletedList1.DataSource = ViewState["entries"]; BulletedList1.DataBind(); }
private void bindData() { BulletedList1.DataSource = Application["entries"]; BulletedList1.DataBind(); }
protected void Bind(CloudBlobContainer container, string fname) { CloudBlockBlob blockBlob = container.GetBlockBlobReference("userout/" + fname.Trim() + ".txt"); string aa = blockBlob.DownloadText(); List <string> Finish = JsonConvert.DeserializeObject <List <string> >(aa); IEnumerable <string> MaxUser = JsonConvert.DeserializeObject <IEnumerable <string> >(Finish[0]); Dictionary <string, double> uCountry = JsonConvert.DeserializeObject <Dictionary <string, double> >(Finish[1]); IEnumerable <KeyValuePair <string, double> > uSources = JsonConvert.DeserializeObject <IEnumerable <KeyValuePair <string, double> > >(Finish[2]); List <KeyValuePair <long, int> > LDates = JsonConvert.DeserializeObject <List <KeyValuePair <long, int> > >(Finish[3]); int RetweetSum = JsonConvert.DeserializeObject <int>(Finish[4]); int FavouriteSum = JsonConvert.DeserializeObject <int>(Finish[5]); int tweetsCount = JsonConvert.DeserializeObject <int>(Finish[6]); Dictionary <string, int> Others = new Dictionary <string, int>(); Dictionary <string, int> Dates = new Dictionary <string, int>(); Others.Add("Retweets", RetweetSum); Others.Add("Favourites", FavouriteSum); Others.Add("tweets", tweetsCount); foreach (var item in LDates.Take(30)) { DateTime d = new DateTime(item.Key); Dates.Add(d.ToString(), item.Value); } BulletedList1.DataSource = MaxUser; BulletedList1.DataBind(); this.chDates.DataSource = Dates; chDates.Series["Series1"].IsXValueIndexed = true; chDates.ChartAreas["ChartArea1"].AxisX.Title = "Dates"; chDates.ChartAreas["ChartArea1"].AxisY.Title = "Count"; chDates.ChartAreas["ChartArea1"].AxisX.TitleFont = new Font("Sans Serif", 12, FontStyle.Bold); chDates.ChartAreas["ChartArea1"].AxisY.TitleFont = new Font("Sans Serif", 12, FontStyle.Bold); foreach (KeyValuePair <string, int> employee in Dates) { chDates.Series[0].Points.AddXY(employee.Key, employee.Value); } this.chDates.DataBind(); this.chCountries.DataSource = uCountry; chCountries.Series["Series1"].IsXValueIndexed = true; chCountries.ChartAreas["ChartArea1"].AxisX.Title = "Country Name"; chCountries.ChartAreas["ChartArea1"].AxisY.Title = "Count"; chCountries.ChartAreas["ChartArea1"].AxisX.TitleFont = new Font("Sans Serif", 10, FontStyle.Bold); chCountries.ChartAreas["ChartArea1"].AxisY.TitleFont = new Font("Sans Serif", 10, FontStyle.Bold); foreach (KeyValuePair <string, double> employee in uCountry) { chCountries.Series[0].Points.AddXY(employee.Key, employee.Value * 100); } this.chCountries.DataBind(); this.chSources.DataSource = uSources; chSources.Series["Series1"].IsXValueIndexed = true; chSources.ChartAreas["ChartArea1"].AxisX.Title = "Source Name"; chSources.ChartAreas["ChartArea1"].AxisY.Title = "Count"; chSources.ChartAreas["ChartArea1"].AxisX.TitleFont = new Font("Sans Serif", 10, FontStyle.Bold); chSources.ChartAreas["ChartArea1"].AxisY.TitleFont = new Font("Sans Serif", 10, FontStyle.Bold); foreach (KeyValuePair <string, double> employee in uSources) { chSources.Series[0].Points.AddXY(employee.Key + (employee.Value * 100).ToString(), employee.Value * 100); // } this.chSources.DataBind(); this.ChOthers.DataSource = Others; ChOthers.Series["Series1"].IsXValueIndexed = true; ChOthers.ChartAreas["ChartArea1"].AxisX.Title = "Name"; ChOthers.ChartAreas["ChartArea1"].AxisY.Title = "Count"; ChOthers.ChartAreas["ChartArea1"].AxisX.TitleFont = new Font("Sans Serif", 10, FontStyle.Bold); ChOthers.ChartAreas["ChartArea1"].AxisY.TitleFont = new Font("Sans Serif", 10, FontStyle.Bold); foreach (KeyValuePair <string, int> employee in Others) { ChOthers.Series[0].Points.AddXY(employee.Key, employee.Value); } this.ChOthers.DataBind(); }