private void FillCompanydrp() { string strSql = "SELECT COMPANY_ID,replace(convert(char(40),ltrim(COMPANY_NAME ))+COMPANY_ID,' ',' ' ) as COMPANYNAME FROM ENT_COMPANY where COMPANY_ISDELETED='0'"; SqlConnection con = new SqlConnection(m_connectons); con.Open(); SqlCommand cmd = new SqlCommand(strSql, con); SqlDataAdapter adpt = new SqlDataAdapter(cmd); DataSet thisDataSet = new DataSet(); adpt.Fill(thisDataSet); ListBox2.DataValueField = "COMPANY_ID"; ListBox2.DataTextField = "COMPANYNAME"; ListBox2.DataSource = thisDataSet.Tables[0]; ListBox2.DataBind(); ListBox8.DataValueField = "COMPANY_ID"; ListBox8.DataTextField = "COMPANYNAME"; ListBox8.DataSource = thisDataSet.Tables[0]; ListBox8.DataBind(); }
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(); }