protected void Page_Load(object sender, EventArgs e) { var makes = new List <string> { "Ação", "Animação", "Comédia", "Corridas", "Erótico", "Aventura", "Documentário", "Drama" , "Fantasia", "Ficção", "Guerra", "Musical", "Policial", "Religioso", "Romance", "Terror" }; var ator = new List <string> { "Al Pacino ", "Jack Nicholson", "Chiwetel Ejiofor", "Amanda Peet", "Woody Harrelson", "Morgan Freeman", "Brad Pitt", "Angelina Jolie", "Benedict Cumberbatch", "Salvador Dalí", "Al Dalí", "Miranda Cosgrove", "Rik Mayall", "Jimmy Fallon" }; var escritor = new List <string> { "Roland Emmerich", "Harald Kloser", "Chiwetel Ejiofor", "Amanda Peet", "Arthur C. Clarke ", " Peter Hyams", "Benedict Cumberbatch", "Salvador Dalí", }; var song = new List <string> { "The impact ", "Ashes in D.C", "Singin' in the Rain", "Skyfall", "Born to Be Wild" }; var directores = new List <string> { "Ingmar Bergman", "Benedict Cumberbatch", "Chiwetel Ejiofor", "Amanda Peet", "Salvador Dalí", "Federico Fellini", "Francis Ford Coppola", "Charles Chaplin", "Tim Burton", "Roman Polanski", "Roland Emmerich " }; makes.Sort(); ator.Sort(); escritor.Sort(); song.Sort(); directores.Sort(); CheckBoxList2.DataSource = escritor; CheckBoxList2.DataBind(); cblEmployees.DataSource = ator; cblEmployees.DataBind(); cblEmployees.DataSource = directores; DropDownList1.DataBind(); for (int i = 1889; i < 2016; i++) { DropDownList3.Items.Add(i.ToString()); } CheckBoxList3.DataSource = song; CheckBoxList3.DataBind(); DropDownList2.DataSource = makes; DropDownList2.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["UserId"] == null) { Response.Redirect("Welcome.aspx"); } Session.Timeout = 120; SectionPanel.Visible = false; DistrictPanel.CssClass = "col-lg-12"; SqlDataReader re = DataConnection.selectQuery("select * from member where memeberid = " + Convert.ToInt32(Session["RCV"]) + " and admin = 'A'"); if (re.HasRows) { SectionPanel.Visible = true; DistrictPanel.CssClass = "col-lg-6"; } int count = CheckBoxList2.Items.Count; SqlDataReader reader = DataConnection.selectQuery("select location,memeberid from member where Department='section'"); if (reader.HasRows) { //List<String> lst = new List<string>(); while (reader.Read()) { ListItem item = new ListItem(); item.Text = reader.GetString(0); item.Value = reader.GetInt32(1).ToString(); item.Selected = false; CheckBoxList2.Items.Add(item); } } reader.Close(); DataConnection.closeConnection(); //count = CheckBoxList3.Items.Count; reader = DataConnection.selectQuery("select location,memeberid from member where Department='dist'"); if (reader.HasRows) { //List<String> lst = new List<string>(); while (reader.Read()) { ListItem item = new ListItem(); item.Text = reader.GetString(0); item.Value = reader.GetInt32(1).ToString(); item.Selected = false; CheckBoxList3.Items.Add(item); } } reader.Close(); DataConnection.closeConnection(); CheckBoxList2.DataBind(); CheckBoxList3.DataBind(); }
private void LoadPlantName() { try { Datechanged(); String dbConnStr = ConfigurationManager.ConnectionStrings["AMPSConnectionString"].ConnectionString; SqlConnection conn = null; using (conn = new SqlConnection(dbConnStr)) { SqlCommand sqlCmd = new SqlCommand("dbo.[Get_PlantwiseSingleBilldateOverAllDataReport]"); conn.Open(); sqlCmd.Connection = conn; sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.Parameters.AddWithValue("@spccode", Company_code); sqlCmd.Parameters.AddWithValue("@spfrmdate", d1.ToString()); sqlCmd.Parameters.AddWithValue("@sptodate", d2.ToString()); SqlDataAdapter da = new SqlDataAdapter(sqlCmd); da.Fill(ds); if (ds != null) { CheckBoxList1.DataSource = ds; CheckBoxList1.DataTextField = "PlantName"; CheckBoxList1.DataValueField = "pcode"; CheckBoxList1.DataBind(); CheckBoxList2.DataSource = ds; CheckBoxList2.DataTextField = "Frmtodate2"; CheckBoxList2.DataValueField = "Frmtodate3"; CheckBoxList2.DataBind(); CheckBoxList3.DataSource = ds; CheckBoxList3.DataTextField = "Frmtodate1"; CheckBoxList3.DataValueField = "Frmtodate4"; CheckBoxList3.DataBind(); } else { } } } catch (Exception ex) { Lbl_Errormsg.Visible = true; Lbl_Errormsg.Text = ex.ToString(); } }
void projectList() { con.Open(); DataSet ds = new DataSet(); SqlDataAdapter adp = new SqlDataAdapter("select * from proTable", con); adp.Fill(ds); CheckBoxList3.DataSource = ds; CheckBoxList3.DataTextField = "ProjectTitle"; CheckBoxList3.DataBind(); con.Close(); }
private void BindCheckBoxList3() { List <TestClass> myList = new List <TestClass>(); myList.Add(new TestClass("value1", "数据绑定值 1")); myList.Add(new TestClass("value2", "数据绑定值 2")); myList.Add(new TestClass("value3", "数据绑定值 3")); myList.Add(new TestClass("value4", "数据绑定值 4")); myList.Add(new TestClass("value5", "数据绑定值 5")); myList.Add(new TestClass("value6", "数据绑定值 6")); myList.Add(new TestClass("value7", "数据绑定值 7")); myList.Add(new TestClass("value8", "数据绑定值 8")); myList.Add(new TestClass("value9", "数据绑定值 9")); CheckBoxList3.DataTextField = "Name"; CheckBoxList3.DataValueField = "Id"; CheckBoxList3.DataSource = myList; CheckBoxList3.DataBind(); CheckBoxList3.SelectedValueArray = new string[] { "value1", "value2", "value6", "value7" }; }
private void BindCheckBoxListMaster(int tidd) { try { ds = MBLL.GetSubMenuTitleCheckBoxMaster(tidd); if (tidd == 1) { CheckBoxList1.DataSource = ds; CheckBoxList1.DataTextField = "SubMenuName"; CheckBoxList1.DataValueField = "SubMenuValue"; CheckBoxList1.DataBind(); } else if (tidd == 2) { CheckBoxList2.DataSource = ds; CheckBoxList2.DataTextField = "SubMenuName"; CheckBoxList2.DataValueField = "SubMenuValue"; CheckBoxList2.DataBind(); } else if (tidd == 3) { CheckBoxList3.DataSource = ds; CheckBoxList3.DataTextField = "SubMenuName"; CheckBoxList3.DataValueField = "SubMenuValue"; CheckBoxList3.DataBind(); } else if (tidd == 4) { CheckBoxList4.DataSource = ds; CheckBoxList4.DataTextField = "SubMenuName"; CheckBoxList4.DataValueField = "SubMenuValue"; CheckBoxList4.DataBind(); } } catch (Exception ex) { ex.Message.ToString(); } }
private void LoadPlantName1() { try { DataSet ds = new DataSet(); String dbConnStr = ConfigurationManager.ConnectionStrings["AMPSConnectionString"].ConnectionString; SqlConnection conn = null; using (conn = new SqlConnection(dbConnStr)) { SqlCommand sqlCmd = new SqlCommand("dbo.[GetPaymentAllot_BalanceAmount]"); conn.Open(); sqlCmd.Connection = conn; sqlCmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter da = new SqlDataAdapter(sqlCmd); da.Fill(ds); if (ds != null) { CheckBoxList1.DataSource = ds; CheckBoxList1.DataTextField = "Plant"; CheckBoxList1.DataValueField = "Plant";//ROUTE_ID CheckBoxList1.DataBind(); CheckBoxList2.DataSource = ds; CheckBoxList2.DataTextField = "BalanceAmount"; CheckBoxList2.DataValueField = "BalanceAmount";//ROUTE_ID CheckBoxList2.DataBind(); CheckBoxList3.DataSource = ds; CheckBoxList3.DataTextField = "Billdate"; CheckBoxList3.DataValueField = "Billdate";//ROUTE_ID CheckBoxList3.DataBind(); } } } catch (Exception ex) { } }
private void BindprocurementRemarksData() { try { DateTime dt1 = new DateTime(); dt1 = DateTime.ParseExact(txt_RemmarksDate.Text, "dd/MM/yyyy", null); if (rd_sesAm.Checked == true) { ses = "AM"; } else { ses = "PM"; } string d1 = dt1.ToString("MM/dd/yyyy"); ds = Bllproimp.LoadProocurementRemarksDatas(ccode, pcode, d1, ses, IncdecFlag); if (ds != null) { CheckBoxList_Sno.DataSource = ds; CheckBoxList_Sno.DataTextField = "serial_no"; CheckBoxList_Sno.DataValueField = "serial_no"; CheckBoxList_Sno.DataBind(); CheckBoxList1.DataSource = ds; CheckBoxList1.DataTextField = "SampleId"; CheckBoxList1.DataValueField = "SampleId"; CheckBoxList1.DataBind(); CheckBoxList2.DataSource = ds; CheckBoxList2.DataTextField = "agent_Id"; CheckBoxList2.DataValueField = "agent_Id"; CheckBoxList2.DataBind(); CheckBoxList3.DataSource = ds; CheckBoxList3.DataTextField = "milk_Kg"; CheckBoxList3.DataValueField = "milk_Kg"; CheckBoxList3.DataBind(); CheckBoxList4.DataSource = ds; CheckBoxList4.DataTextField = "fat"; CheckBoxList4.DataValueField = "fat"; CheckBoxList4.DataBind(); CheckBoxList5.DataSource = ds; CheckBoxList5.DataTextField = "snf"; CheckBoxList5.DataValueField = "snf"; CheckBoxList5.DataBind(); CheckBoxList6.DataSource = ds; CheckBoxList6.DataTextField = "magent_Id"; CheckBoxList6.DataValueField = "magent_Id"; CheckBoxList6.DataBind(); CheckBoxList7.DataSource = ds; CheckBoxList7.DataTextField = "mmilk_Kg"; CheckBoxList7.DataValueField = "mmilk_Kg"; CheckBoxList7.DataBind(); CheckBoxList8.DataSource = ds; CheckBoxList8.DataTextField = "mfat"; CheckBoxList8.DataValueField = "mfat"; CheckBoxList8.DataBind(); CheckBoxList9.DataSource = ds; CheckBoxList9.DataTextField = "msnf"; CheckBoxList9.DataValueField = "msnf"; CheckBoxList9.DataBind(); } //Adding color to differenciate the remarks modifications Start SetColorRemarksData(); //Adding color to differenciate the remarks modifications End } catch (Exception ex) { } CheckBoxListClear1(); }
protected void Page_Load(object sender, EventArgs e) { if (Request.Cookies["admin"] == null || string.IsNullOrEmpty(Request.Cookies["admin"].Value)) { Response.Write("<script>top.location.href='default.aspx';</script>"); Response.End(); } //string table = "testNews"; //string id = "1"; string table = Request.QueryString["t"]; string id = Request.QueryString["id"]; string p = Request.QueryString["p"]; //string s = Request.QueryString["s"]; string m = Request.QueryString["m"]; Table t = new Table(table); if (string.IsNullOrEmpty(m)) { m = table; } this.tableName.Value = table; this.thisID.Value = id; if (!IsPostBack) { /*地区选择*/ if (isRoleTable(table)) { /*string[] areaids = { }, areaid = { }; * if (id != null) * { * DataTable dt = DBFactory.GetConn().exeTable("select top 1 [area] from [" + table + "] where [id]=" + id); * areaids = dt.Rows[0][0].ToString().Split('|'); * } * * CheckBoxList1.DataSource = DBFactory.GetConn().exeTable("select [id],[typename] from [countryType] where [pid]=0 order by [orderid]"); * CheckBoxList1.DataTextField = "typename"; * CheckBoxList1.DataValueField = "id"; * CheckBoxList1.DataBind(); * * try * { * if (areaids.Length >= 1 && areaids[0] != null) * { * areaid = areaids[0].Split(','); * for (int i = 0; i < areaid.Length; i++) * { * if (areaid[i] != "" && areaid[i] != ",") CheckBoxList1.Items.FindByValue(areaid[i]).Selected = true; * } * } * } * catch { } * * CheckBoxList2.DataSource = DBFactory.GetConn().exeTable("select [id],[typename] from [countryType] where [pid]<>0 order by [orderid]"); * CheckBoxList2.DataTextField = "typename"; * CheckBoxList2.DataValueField = "id"; * CheckBoxList2.DataBind(); * * try * { * if (areaids.Length >= 2 && areaids[1] != null) * { * areaid = areaids[1].Split(','); * for (int i = 0; i < areaid.Length; i++) * { * if (areaid[i] != "" && areaid[i] != ",") CheckBoxList2.Items.FindByValue(areaid[i]).Selected = true; * } * } * } * catch { }*/ string[] areaids = { }; if (id != null) { DataTable dt = DBFactory.GetConn().exeTable("select top 1 [area] from [" + table + "] where [id]=" + id); areaids = dt.Rows[0][0].ToString().Split(','); } CheckBoxList3.DataSource = DBFactory.GetConn().exeTable("select [id],[title] from [country] order by [orderid] desc"); CheckBoxList3.DataTextField = "title"; CheckBoxList3.DataValueField = "id"; CheckBoxList3.DataBind(); try { for (int i = 0; i < areaids.Length; i++) { if (areaids[i] != "" && areaids[i] != ",") { CheckBoxList3.Items.FindByValue(areaids[i]).Selected = true; } } } catch { } /*DropDownList1.DataSource = DBFactory.GetConn().exeTable("select [id],[typename] from [countryType] where [pid]=0 order by [orderid]"); * DropDownList1.DataTextField = "typename"; * DropDownList1.DataValueField = "id"; * DropDownList1.DataBind(); * * try * { * if (areaid.Length >= 1 && areaid[0] != null && areaid[1] != "") * DropDownList1.Items.FindByValue(areaid[0]).Selected = true;//1 * } * catch { } * * DropDownList2.DataSource = DBFactory.GetConn().exeTable("select [id],[typename] from [countryType] where [pid]=" + DropDownList1.SelectedValue.ToString() + " order by [orderid]"); * DropDownList2.DataTextField = "typename"; * DropDownList2.DataValueField = "id"; * DropDownList2.DataBind(); * * try * { * if (areaid.Length >= 2 && areaid[1] != null && areaid[1] != "") * DropDownList2.Items.FindByValue(areaid[1]).Selected = true;//2 * } * catch { } * * DropDownList3.DataSource = DBFactory.GetConn().exeTable("select [id],[title] from [country] where [typeid]=" + DropDownList2.SelectedValue.ToString() + " order by [orderid] desc"); * DropDownList3.DataTextField = "title"; * DropDownList3.DataValueField = "id"; * DropDownList3.DataBind(); * * try * { * if (areaid.Length >= 3 && areaid[2] != null && areaid[1] != "") * DropDownList3.Items.FindByValue(areaid[2]).Selected = true;//3 * } * catch { }*/ } /*地区选择*/ } if (Request.QueryString["f"] != null && !string.IsNullOrEmpty(Request.QueryString["f"])) { this.Literal2.Text = "分类"; } else { this.Literal2.Text = "信息"; } if (Request.QueryString["type"] != null && Request.QueryString["type"] == "add") { this.Literal2.Text += "添加"; } else { this.Literal2.Text += "修改"; } UIHelper.SetupPanel(table, this.main, this, id, false); if (!string.IsNullOrEmpty(p)) { this.addlink.NavigateUrl = "edit.aspx?t=" + table + "&type=add&p=" + p + "&m=" + m; } else { this.addlink.Visible = false; } if (!string.IsNullOrEmpty(m) && (m != table)) { this.menulink.NavigateUrl = "menu.aspx?mt=" + m + "&ct=" + table; } else { this.menulink.Visible = false; } if ((!string.IsNullOrEmpty(m)) && (new Table(m)).AddChildDepth != 0) { this.addmenulink.NavigateUrl = "edit.aspx?id=0&type=add&f=menu&t=" + m; } else { this.addmenulink.Visible = false; } if (t.IsSingle) { this.listlink.Visible = false; this.Literal3.Visible = false; this.searchKey.Visible = false; this.ImageButton1.Visible = false; } else { this.listlink.NavigateUrl = "list.aspx?t=" + table + "&m=" + m + "&p=" + p; } int pid = 0; try { pid = int.Parse(p); } catch (Exception ex) { } try { this.Literal1.Text = UIHelper.Location(m, pid); } catch (Exception ex) { } this.Literal1.Text += " → " + this.Literal2.Text; }
protected void Button1_Click(object sender, EventArgs e) { string message = ""; string memberno = ""; CheckBoxList2.DataBind(); CheckBoxList3.DataBind(); CheckBoxList4.DataBind(); CheckBoxList5.DataBind(); CheckBoxList6.DataBind(); if (Session["sgques"].ToString() == "SendData") { DataConnection.insertQuery("update message set sgsubmit='T' where QNO=N'" + Session["quesno"].ToString() + "' and Assemblys=N'" + Session["sadan"].ToString() + "' and Session=N'" + Session["session"].ToString() + "'"); DataConnection.insertQuery("insert into miscellenous (other_posist_name,posist_no,posist_date,answer_mem_name,ans_no,ans_date,remark,session,assemblys,quesno) values('" + TextBox8.Text + "','" + TextBox9.Text + "','" + Convert.ToDateTime(TextBox10.Text) + "','" + TextBox11.Text + "','" + TextBox12.Text + "','" + Convert.ToDateTime(TextBox13.Text) + "','" + TextBox14.Text + "','" + Session["session"].ToString() + "','" + Session["sadan"] + "'," + Convert.ToInt32(Session["quesno"].ToString()) + ")"); Response.Redirect("Dashboard.aspx"); } else { if (getCheckBoxCount(CheckBoxList2) > 0) { for (int i = 0; i < CheckBoxList2.Items.Count; i++) { if (CheckBoxList2.Items[i].Selected) { SqlDataReader r1 = DataConnection.selectQuery("select memeberid from member where member_name=N'" + CheckBoxList2.Items[i].Text.Trim() + "'"); if (r1.HasRows) { while (r1.Read()) { memberno = r1.GetInt32(0).ToString(); } } r1.Close(); DataConnection.insertQuery("insert into message(QNO,RCV,Sender,Assemblys,Session) values(N'" + Session["quesno"].ToString() + "',N'" + memberno + "',N'" + Session["RCV"].ToString() + "',N'" + Session["assembly"].ToString() + "',N'" + Session["Session"].ToString() + "')"); } } } if (getCheckBoxCount(CheckBoxList3) > 0) { for (int i = 0; i < CheckBoxList3.Items.Count; i++) { if (CheckBoxList3.Items[i].Selected) { SqlDataReader r = DataConnection.selectQuery("select memeberid from member where location=N'" + CheckBoxList3.Items[i].Text.Trim() + "'"); if (r.HasRows) { while (r.Read()) { memberno = r.GetInt32(0).ToString(); } } r.Close(); DataConnection.insertQuery("insert into message(QNO,RCV,Sender,Assemblys,Session) values(N'" + Session["quesno"].ToString() + "',N'" + memberno + "',N'" + Session["RCV"].ToString() + "',N'" + Session["assembly"].ToString() + "',N'" + Session["Session"].ToString() + "')"); } } } if (getCheckBoxCount(CheckBoxList4) > 0) { for (int i = 0; i < CheckBoxList4.Items.Count; i++) { if (CheckBoxList4.Items[i].Selected) { SqlDataReader re = DataConnection.selectQuery("select memeberid from member where location=N'" + CheckBoxList4.Items[i].Text.Trim() + "'"); if (re.HasRows) { while (re.Read()) { memberno = re.GetInt32(0).ToString(); } re.Close(); DataConnection.insertQuery("insert into message(QNO,RCV,Sender,Assemblys,Session) values(N'" + Session["quesno"].ToString() + "',N'" + memberno + "',N'" + Session["RCV"].ToString() + "',N'" + Session["assembly"].ToString() + "',N'" + Session["Session"].ToString() + "')"); } } } } if (getCheckBoxCount(CheckBoxList5) > 0) { for (int i = 0; i < CheckBoxList5.Items.Count; i++) { if (CheckBoxList5.Items[i].Selected) { SqlDataReader re2 = DataConnection.selectQuery("select memeberid from member where location=N'" + CheckBoxList5.Items[i].Text.Trim() + "'"); if (re2.HasRows) { while (re2.Read()) { memberno = re2.GetInt32(0).ToString(); } re2.Close(); DataConnection.insertQuery("insert into message(QNO,RCV,Sender,Assemblys,Session) values(N'" + Session["quesno"].ToString() + "',N'" + memberno + "',N'" + Session["RCV"].ToString() + "',N'" + Session["assembly"].ToString() + "',N'" + Session["Session"].ToString() + "')"); } } } } if (getCheckBoxCount(CheckBoxList6) > 0) { for (int i = 0; i < CheckBoxList6.Items.Count; i++) { if (CheckBoxList6.Items[i].Selected) { SqlDataReader re3 = DataConnection.selectQuery("select memeberid from member where location=N'" + CheckBoxList6.Items[i].Text.Trim() + "'"); if (re3.HasRows) { while (re3.Read()) { memberno = re3.GetInt32(0).ToString(); } re3.Close(); DataConnection.insertQuery("insert into message(QNO,RCV,Sender,Assemblys,Session) values(N'" + Session["quesno"].ToString() + "',N'" + memberno + "',N'" + Session["RCV"].ToString() + "',N'" + Session["assembly"].ToString() + "',N'" + Session["Session"].ToString() + "')"); } } } } if (getCheckBoxCount(CheckBoxList2) < 0) { message = "Select Atleast Section "; ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert('" + message + "');", true); return; } } message = "Data has Stored Successfully"; ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert('" + message + "');", true); Response.Redirect("Dashboard.aspx"); }
protected void Page_Load(object sender, EventArgs e) { List <string> cities = new List <string>(); cities.Add("Gilgit"); cities.Add("Chitral"); cities.Add("Dasu"); cities.Add("Dir"); cities.Add("Malakand"); cities.Add("Noshera"); cities.Add("Mansehra"); cities.Add("Hassan Abdal"); cities.Add("Peshawar"); cities.Add("Attock"); cities.Add("Kohat"); cities.Add("Islamabad"); cities.Add("Murree"); cities.Add("Rawat"); cities.Add("Balkasar"); cities.Add("Chakwal"); cities.Add("Mianwali"); cities.Add("Bhera"); cities.Add("Sargoda"); cities.Add("Pindi Bhattian"); cities.Add("Jhang"); cities.Add("Faisalabad"); cities.Add("Lahore"); cities.Add("Dina"); cities.Add("Gujranwala"); cities.Add("Multan"); cities.Add("DG Khan"); cities.Add("Bahwalpur"); cities.Add("Sukkur"); cities.Add("Rajanpur"); cities.Add("Loralai"); cities.Add("Jacobabad"); cities.Add("Quetta"); cities.Add("Khuzdar"); cities.Add("Karachi"); cities.Add("Lasbela"); cities.Add("Gwadar"); cities.Add("Awaran"); cities.Add("Turbat"); if (!IsPostBack) { CheckBoxList1.DataSource = cities; CheckBoxList2.DataSource = cities; CheckBoxList3.DataSource = cities; CheckBoxList1.DataBind(); CheckBoxList2.DataBind(); CheckBoxList3.DataBind(); } GridView1.DataSource = ExcelToDS().Tables[0]; GridView1.DataBind(); loadData(); int[,] prep2 = new int[39, 39]; int[,] D1 = resetMatrix(mygraph.vedges); for (int i = 0; i < 39; i++) { for (int j = 0; j < 39; j++) { prep2[i, j] = D1[i, j]; } } // int[,] prevD = resetMatrix2(mygraph.vedges); int [,] Dp = Floyd(D1, 39); //========================================================================// Prims obj = new Prims(); List <totaledgs> newlist = obj.primMST(mygraph.vedges); ListBox7.DataSource = newlist; ListBox8.DataSource = newlist; ListBox9.DataSource = newlist; Label2.Text = newlist[1].Weight.ToString(); ListBox7.DataTextField = "src"; ListBox7.DataBind(); ListBox8.DataTextField = "dst"; ListBox8.DataBind(); ListBox9.DataTextField = "weight"; ListBox9.DataBind(); }