protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e) { string topicname = DropDownList3.Text; SqlConnection con = new SqlConnection("data source=.\\SQLEXPRESS;Initial Catalog=BB;Integrated security=true"); con.Open(); string sql2 = "select * from tbl_question where topic_id='" + topicname + "'"; SqlDataAdapter adpt = new SqlDataAdapter(sql2, con); DataTable dt2 = new DataTable(); adpt.Fill(dt2); DropDownList4.DataTextField = "question"; DropDownList4.DataValueField = "Que_id"; DropDownList4.DataSource = dt2; DropDownList4.DataBind(); DropDownList4.Items.Insert(0, "select one"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DropDownList4.DataValueField = "Cmp_No"; DropDownList4.DataTextField = "Cmp_Nm"; DropDownList4.DataSource = db.MainCmpnam.ToList(); DropDownList4.DataBind(); TextBox22.Text = DropDownList4.SelectedValue; DropDownList5.DataValueField = "Brn_No"; DropDownList5.DataTextField = "Brn_NmAr"; DropDownList5.DataSource = db.MainBranch.ToList(); DropDownList5.DataBind(); ViewState["id"] = 0; load_tree(); } }
public void que() { con = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\Users\\Pratik\\Desktop\\Jobadda\\App_Data\\JobportalDB.mdf;Integrated Security=True;User Instance=True"); con.Open(); string query = "select * from Question"; adp = new SqlDataAdapter(query, con); DataSet ds = new DataSet(); adp.Fill(ds); DropDownList4.DataSource = ds.Tables[0]; DropDownList4.DataTextField = "question"; DropDownList4.DataValueField = "que_id"; DropDownList4.DataBind(); DropDownList4.Items.Insert(0, new ListItem("select", "0")); con.Close(); }
protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e) { DataSet ds = new DataSet(); string sa = "select * from city where sid = '" + DropDownList3.SelectedValue + "'"; cmd = new SqlCommand(sa, con); con.Open(); ad = new SqlDataAdapter(cmd); ad.Fill(ds); con.Close(); if (ds.Tables[0].Rows.Count > 0) { DropDownList4.DataTextField = ds.Tables[0].Columns[1].ToString(); DropDownList4.DataValueField = ds.Tables[0].Columns[0].ToString(); DropDownList4.DataSource = ds; DropDownList4.DataBind(); DropDownList4.Items.Insert(0, new ListItem("--select city--", "")); } }
protected void Page_Load(object sender, EventArgs e) { if (Request.Params["id"] != null && Request.Params["id"].Trim() != "") { BuyOrder_ID = (Convert.ToInt32(Request.Params["id"])); ShowInfo(BuyOrder_ID); } if (!IsPostBack) { DropDownList1.DataSource = Dept; DropDownList1.DataTextField = "Name"; DropDownList1.DataValueField = "Dept_ID"; DropDownList1.DataBind(); //DropDownList2.DataSource = Supplier; //DropDownList2.DataTextField = "Name"; //DropDownList2.DataValueField = "Supplier_ID"; //DropDownList2.DataBind(); DropDownList3.DataSource = Employee; DropDownList3.DataTextField = "Name"; DropDownList3.DataValueField = "Employee_ID"; DropDownList3.DataBind(); DropDownList4.DataSource = StoreHouse; DropDownList4.DataTextField = "Address"; DropDownList4.DataValueField = "StoreHouse_ID"; DropDownList4.DataBind(); } DataSet BuyOrder_Detail = new BLL.BuyOrder_Detail().GetProDetail(BuyOrder_ID); Repeater1.DataSource = BuyOrder_Detail; Repeater1.DataBind(); decimal TotalPrice = 0; foreach (RepeaterItem item in Repeater1.Items) { Label LB1 = (Label)item.FindControl("Label5"); //单价 Label LB2 = (Label)item.FindControl("Label6"); //数量 Label LB3 = (Label)item.FindControl("Label7"); //合计 LB3.Text = (Convert.ToDecimal(LB1.Text) * Convert.ToDecimal(LB2.Text)).ToString(); TotalPrice += Convert.ToDecimal(LB3.Text); } Label8.Text = TotalPrice.ToString(); Label9.Text = Maticsoft.Common.Rmb.CmycurD(TotalPrice); }
private void showdropdown() { SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["connection"]); SqlCommand cmd = new SqlCommand("Select * from account_entry ORDER BY No asc", con); con.Open(); DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(ds); DropDownList4.DataSource = ds; DropDownList4.DataTextField = "Account_name"; DropDownList4.DataValueField = "No"; DropDownList4.DataBind(); DropDownList4.Items.Insert(0, new ListItem("All", "0")); con.Close(); }
private void BindGender() { SqlCommand cmd = new SqlCommand("sp_gender1", con); cmd.CommandType = CommandType.StoredProcedure; con.Open(); SqlDataAdapter sda = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); sda.Fill(dt); if (dt.Rows.Count != 0) { DropDownList4.DataSource = dt; DropDownList4.DataTextField = "GenderName"; DropDownList4.DataValueField = "GenderId"; DropDownList4.DataBind(); DropDownList4.Items.Insert(0, new ListItem("-Select-", "0")); } con.Close(); }
protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e) { Button2.Visible = false; GridView1.Visible = false; Label1.Visible = false; TextBox1.Visible = false; SqlCommand comm = new SqlCommand(); comm.CommandText = " select bdname,beh_id from behavier where crs_id=" + DropDownList3.SelectedValue; comm.Connection = con; con.Open(); SqlDataReader da1 = comm.ExecuteReader(); DropDownList4.DataSource = da1; DropDownList4.DataTextField = "bdname"; DropDownList4.DataValueField = "beh_id"; DropDownList4.DataBind(); con.Close(); DropDownList4.Items.Add("null"); }
public void city() { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["mycon"].ToString()); con.Open(); SqlDataAdapter adp = null; string query = "select * from City where City.state_id=" + DropDownList3.SelectedValue; adp = new SqlDataAdapter(query, con); DataSet ds = new DataSet(); adp.Fill(ds); DropDownList4.DataSource = ds.Tables[0]; DropDownList4.DataTextField = "city_name"; DropDownList4.DataValueField = "city_id"; DropDownList4.DataBind(); DropDownList4.Items.Insert(0, new ListItem("select", "0")); con.Close(); }
private void BindGender() { SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\aditya\source\repos\practice\practice\App_Data\Database1.mdf;Integrated Security=True"); con.Open(); SqlCommand cmd = new SqlCommand("select * from gender with(nolock)", con); SqlDataAdapter sda = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); sda.Fill(dt); if (dt.Rows.Count != 0) { DropDownList4.DataSource = dt; DropDownList4.DataTextField = "genderName"; DropDownList4.DataValueField = "genderId"; DropDownList4.DataBind(); DropDownList4.Items.Insert(0, new ListItem("-Select-", "0")); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Session["UserID"] = 0; movrepo = new MovieRepository(); List <MoviesGridData> mov = movrepo.GetMoviesForGrid(); GridView1.DataSource = mov; GridView1.DataBind(); lanrepo = new LanguageRepository(); movrepo = new MovieRepository(); qulrepo = new QualityRepository(); genrepo = new GenreRepository(); List <LanguageTable> lan = lanrepo.GetAllLanguages(); List <GenreTable> gen = genrepo.GetAllGenres(); List <QualityTable> qual = qulrepo.GetAllQualities(); List <ReleaseYear> yr = movrepo.GetYears(); DropDownList1.DataSource = lan; DropDownList1.DataTextField = "LanguageName"; DropDownList1.DataValueField = "LanguageID"; DropDownList1.DataBind(); DropDownList2.DataSource = qual; DropDownList2.DataTextField = "QualityName"; DropDownList2.DataValueField = "QualityID"; DropDownList2.DataBind(); DropDownList3.DataSource = gen; DropDownList3.DataTextField = "GenreName"; DropDownList3.DataValueField = "GenreID"; DropDownList3.DataBind(); DropDownList4.DataSource = yr; DropDownList4.DataBind(); } }
protected void fillcity() { DropDownList4.Items.Clear(); if (DropDownList3.SelectedIndex > 0) { string qryStr = "select CityId,CityName from CityMasterTbl where StateId=" + DropDownList3.SelectedValue + " order by CityName"; SqlDataAdapter da = new SqlDataAdapter(qryStr, con); DataTable dt = new DataTable(); da.Fill(dt); DropDownList4.DataSource = dt; DropDownList4.DataTextField = "CityName"; DropDownList4.DataValueField = "CityId"; DropDownList4.DataBind(); } else { DropDownList4.Items.Insert(0, "-Select-"); DropDownList4.Items[0].Value = "0"; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { List <string> itemcode = scService.getItemcode(); DropDownList1.DataSource = itemcode; DropDownList1.DataBind(); List <string> suppliercode = scService.getSuppliercode(); DropDownList2.DataSource = suppliercode; DropDownList2.DataBind(); //suppliercode.Remove(DropDownList2.SelectedValue); DropDownList3.DataSource = suppliercode; DropDownList3.DataBind(); //suppliercode.Remove(DropDownList3.SelectedValue); DropDownList4.DataSource = suppliercode; DropDownList4.DataBind(); } }
protected void DropDownList4_SelectedIndexChanged(object sender, EventArgs e) { if (DropDownList3.SelectedValue == "-1") { DropDownList4.SelectedIndex = 0; DropDownList4.Enabled = false; } else { SqlConnection con; DropDownList4.Enabled = true; SqlDataReader d = DataManager.GetDataReader("getZonesbycitiesID", out con, new SqlParameter("@city_id", DropDownList1.SelectedValue)); DropDownList4.DataSource = d; DropDownList4.DataTextField = "zone_name"; DropDownList4.DataValueField = "zone_id"; DropDownList4.DataBind(); con.Close(); } MultiView1.ActiveViewIndex = 3; }
protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e) { if (!DropDownList3.SelectedValue.Equals("請選擇")) { sql_str = @" select distinct(t.recipe_id) as recipe_id from ldr_cf_step_mapping_t t where t.equip_id='{0}' and t.product_id='{1}' and t.sub_equip_id='{2}' order by recipe_id"; sql_str = string.Format(sql_str, DropDownList1.SelectedValue, DropDownList2.SelectedValue, DropDownList3.SelectedValue); ds_temp = func.get_dataSet_access(sql_str, conn); DropDownList4.DataSource = ds_temp.Tables[0]; DropDownList4.DataTextField = "recipe_id"; DropDownList4.DataValueField = "recipe_id"; DropDownList4.DataBind(); DropDownList4.Items.Insert(0, "請選擇"); } }
private void filldrop() { DropDownList3.DataSource = getuserdata(); DropDownList3.DataTextField = "CourseId"; //DropDownList3.DataValueField = "CourseTitle"; DropDownList3.DataBind(); DropDownList4.DataSource = getsectiondata(); DropDownList4.DataTextField = "SectionId"; //DropDownList4.DataValueField = "SectionTitle"; // DropDownList4.DataValueField = "SectionDetails"; DropDownList4.DataBind(); DropDownList1.DataSource = getTeacherdata(); DropDownList1.DataTextField = "TeacherId"; // DropDownList1.DataValueField = "Name"; //DropDownList1.DataValueField = "Email"; //DropDownList1.DataValueField = "PhoneNumber"; DropDownList1.DataBind(); }
protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e) { if (Session["company_id"] != null) { company_id = Convert.ToInt32(Session["company_id"].ToString()); } SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["connection"]); SqlCommand cmd = new SqlCommand("Select * from subcategory where category_id='" + DropDownList3.SelectedItem.Value + "' and Com_Id='" + DropDownList1.SelectedItem.Value + "'", con); con.Open(); DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(ds); DropDownList4.DataSource = ds; DropDownList4.DataTextField = "subcategoryname"; DropDownList4.DataValueField = "subcategory_id"; DropDownList4.DataBind(); DropDownList4.Items.Insert(0, new ListItem("All", "0")); con.Close(); if (Session["company_id"] != null) { company_id = Convert.ToInt32(Session["company_id"].ToString()); } SqlConnection con1 = new SqlConnection(ConfigurationManager.AppSettings["connection"]); SqlCommand CMD = new SqlCommand("select * from product_stock where Category='" + DropDownList3.SelectedItem.Value + "' and Com_Id='" + DropDownList1.SelectedItem.Value + "' ORDER BY purchase_invoice asc", con1); DataTable dt1 = new DataTable(); con1.Open(); SqlDataAdapter da1 = new SqlDataAdapter(CMD); da1.Fill(dt1); GridView1.DataSource = dt1; GridView1.DataBind(); }
/// <summary> /// 填充下拉菜单 /// </summary> protected void FillDropDownList() { DataTable dt = BLL.Class.BLLGetAllClass(); DropDownList1.DataSource = dt; DropDownList1.DataValueField = dt.Columns[0].ColumnName; DropDownList1.DataTextField = dt.Columns[1].ColumnName; DropDownList1.DataBind(); DropDownList1.Items.Insert(0, "请选择"); DropDownList2.DataSource = dt; DropDownList2.DataValueField = dt.Columns[0].ColumnName; DropDownList2.DataTextField = dt.Columns[1].ColumnName; DropDownList2.DataBind(); DropDownList2.Items.Insert(0, "请选择"); DropDownList4.DataSource = dt; DropDownList4.DataValueField = dt.Columns[0].ColumnName; DropDownList4.DataTextField = dt.Columns[1].ColumnName; DropDownList4.DataBind(); DropDownList4.Items.Insert(0, "请选择"); }
void subkat() { DataSet Ds = new DataSet(); try { string com = "select loc_cd,UPPER(loc_desc) as loc_desc from ref_location"; SqlDataAdapter adpt = new SqlDataAdapter(com, con); DataTable dt = new DataTable(); adpt.Fill(dt); DropDownList4.DataSource = dt; DropDownList4.DataBind(); DropDownList4.DataTextField = "loc_desc"; DropDownList4.DataValueField = "loc_cd"; DropDownList4.DataBind(); DropDownList4.Items.Insert(0, new ListItem("--- PILIH ---", "")); } catch (Exception ex) { throw ex; } }
private void GetDropList() { oraConnection.Open(); string s1 = "Select Laboratory from DIR_LABORATORIES"; OracleDataAdapter oraAdap = new OracleDataAdapter(s1, oraConnection); oraAdap.Fill(ds); if (ds.Tables[0].Rows.Count > 0) { DropDownList1.DataSource = ds; DropDownList1.DataTextField = "Laboratory"; DropDownList1.DataBind(); DropDownList1.Items.Insert(0, new ListItem("-Выберите направление-")); DropDownList1.SelectedIndex = 0; DropDownList2.DataSource = ds; DropDownList2.DataTextField = "Laboratory"; DropDownList2.DataBind(); DropDownList2.Items.Insert(0, new ListItem("-Выберите направление-")); DropDownList2.SelectedIndex = 0; } string s2 = "Select STATUS_L from DIR_STATUS_LEARNER"; OracleDataAdapter oraAdap2 = new OracleDataAdapter(s2, oraConnection); oraAdap2.Fill(dss); if (dss.Tables[0].Rows.Count > 0) { DropDownList4.DataSource = dss; DropDownList4.DataBind(); DropDownList4.Items.Insert(0, new ListItem("-Выберите статус-")); DropDownList4.SelectedIndex = 0; DropDownList5.DataSource = dss; DropDownList5.DataBind(); DropDownList5.Items.Insert(0, new ListItem("-Выберите статус-")); DropDownList5.SelectedIndex = 0; } oraConnection.Close(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DropDownList4.DataValueField = "Cmp_No"; DropDownList4.DataTextField = "Cmp_Nm"; DropDownList4.DataSource = db.MainCmpnam.ToList(); DropDownList4.DataBind(); TextBox28.Text = DropDownList4.SelectedValue; DropDownList5.DataValueField = "Actvty_No"; DropDownList5.DataTextField = "Name_Arb"; DropDownList5.DataSource = db.ActivityTypes.ToList(); DropDownList5.DataBind(); TextBox17.Text = DropDownList5.SelectedValue; ViewState["id"] = 0; load_tree(); } // GridView1.DataSource = query.ToList(); // GridView1.DataBind(); }
void pendi() { DataSet Ds = new DataSet(); try { string com = "select hr_pendi_Code,hr_pendi_desc from Ref_hr_pendidikan"; SqlDataAdapter adpt = new SqlDataAdapter(com, con); DataTable dt = new DataTable(); adpt.Fill(dt); DropDownList4.DataSource = dt; DropDownList4.DataBind(); DropDownList4.DataTextField = "hr_pendi_desc"; DropDownList4.DataValueField = "hr_pendi_Code"; DropDownList4.DataBind(); DropDownList4.Items.Insert(0, new ListItem("--- PILIH ---", "")); } catch (Exception ex) { throw ex; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DropDownList2.DataSource = ProductSpec; DropDownList2.DataTextField = "Name"; DropDownList2.DataValueField = "ProductSpec_ID"; DropDownList2.DataBind(); DropDownList3.DataSource = ProductUnit; DropDownList3.DataTextField = "Name"; DropDownList3.DataValueField = "ProductUnit_ID"; DropDownList3.DataBind(); DropDownList4.DataSource = ProductClass; DropDownList4.DataTextField = "Name"; DropDownList4.DataValueField = "ProductClass_ID"; DropDownList4.DataBind(); DropDownList5.DataSource = Supplier; DropDownList5.DataTextField = "Name"; DropDownList5.DataValueField = "Supplier_ID"; DropDownList5.DataBind(); } }
protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e) { if (User.Identity.IsAuthenticated) { SqlConnection con1000 = new SqlConnection(ConfigurationManager.AppSettings["connection"]); SqlCommand cmd1000 = new SqlCommand("select * from user_details where company_name='" + User.Identity.Name + "'", con1000); SqlDataReader dr1000; con1000.Open(); dr1000 = cmd1000.ExecuteReader(); if (dr1000.Read()) { company_id = Convert.ToInt32(dr1000["com_id"].ToString()); SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["connection"]); SqlCommand cmd = new SqlCommand("Select * from shade_master_details where item_name='" + DropDownList3.SelectedItem.Text + "' and Com_Id='" + company_id + "' ORDER BY shade_id asc", con); con.Open(); DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(ds); DropDownList4.DataSource = ds; DropDownList4.DataTextField = "shade_no"; DropDownList4.DataValueField = "shade_id"; DropDownList4.DataBind(); DropDownList4.Items.Insert(0, new ListItem("Select shade no", "0")); con.Close(); SqlConnection con1 = new SqlConnection(ConfigurationManager.AppSettings["connection"]); SqlCommand CMD1 = new SqlCommand("select * from creditbill_entry_details where item_name='" + DropDownList3.SelectedItem.Text + "' and Com_Id='" + company_id + "' union all select * from cashbill_entry_details where item_name='" + DropDownList3.SelectedItem.Text + "' and Com_Id='" + company_id + "'", con1); DataTable dt11 = new DataTable(); SqlDataAdapter da11 = new SqlDataAdapter(CMD1); da11.Fill(dt11); GridView1.DataSource = dt11; GridView1.DataBind(); } con1000.Close(); } }
//////////////////////////////////WardBoy Selection/////////////////////////////////// protected void onWardSelection() { Ward.Visible = true; DoctorNurse.Visible = false; Patient.Visible = false; // first inflate the latest Rooms ids to choose from SqlCommand cmd = new SqlCommand("SELECT RmId FROM Hos_Room", conn); conn.Open(); SqlDataReader reader = cmd.ExecuteReader(); DropDownList4.DataSource = reader; DropDownList4.DataTextField = "RmId"; DropDownList4.DataValueField = "RmId"; DropDownList4.DataBind(); reader.Close(); conn.Close(); }
protected void filldropdownitems() { string ConnectionString = ConfigurationManager.ConnectionStrings["Database_ConnectionString"].ConnectionString; DropDownList4.DataValueField = "Crime_type"; DropDownList4.DataTextField = "Crime_type"; string strSQL; strSQL = "SELECT distinct [Crime_type] FROM [dbo].[tbl_crimetype]"; SqlConnection conn = new SqlConnection(ConnectionString); conn.Open(); SqlCommand cmd = new SqlCommand(strSQL, conn); SqlDataReader reader = cmd.ExecuteReader(); DropDownList4.DataTextField = "Crime_type"; DropDownList4.DataValueField = "Crime_type"; DropDownList4.DataSource = reader; DropDownList4.DataBind(); DropDownList4.Items.Add("ALL"); DropDownList4.Items.FindByValue("ALL").Selected = true; conn.Close(); }
protected void DropDownList5_SelectedIndexChanged(object sender, EventArgs e) { if (DropDownList5.SelectedValue == "--Select One--") { Page.ClientScript.RegisterStartupScript(GetType(), "popup", "alert('Please Select Valid Period!!');", true); } else if (DropDownList5.SelectedValue == "All") { DropDownList4.Enabled = false; } else { DropDownList4.Enabled = true; string TescoWeek = "select distinct(Tesco_Week) from tbl_TescoCalender where Tesco_Year= " + DropDownList3.SelectedValue + " and Tesco_Period=" + DropDownList5.SelectedValue + " order by Tesco_Week "; DataSet dsWeek = bn.DatabindingTeam(TescoWeek); DropDownList4.DataSource = dsWeek; DropDownList4.DataTextField = "Tesco_Week"; DropDownList4.DataValueField = "Tesco_Week"; DropDownList4.DataBind(); DropDownList4.Items.Insert(0, "--Select One--"); DropDownList4.Items.Insert(1, "All"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { TextBox13.Text = "未选择"; if (Request.QueryString["id"] == null) { Button2.Text = "确认添加"; } else { DataClassesDataContext db = new DataClassesDataContext(); var aa = from r in db.D_C select r; DropDownList4.DataSource = aa; DropDownList4.DataTextField = "AClass"; DropDownList4.DataBind(); pzl(); Button2.Text = "确认修改"; } } }
protected void DropDownList5_SelectedIndexChanged(object sender, EventArgs e) { try { int courseID = Convert.ToInt32(DropDownList2.SelectedValue); string year = DropDownList3.SelectedItem.Text; string sem = DropDownList5.SelectedItem.Text; SqlConnection con = new SqlConnection(str); con.Open(); SqlCommand cmd = new SqlCommand("select * from Subject where CID='" + courseID + "' and Year='" + year + "' and Sem='" + sem + "'", con); DropDownList4.DataSource = cmd.ExecuteReader(); DropDownList4.DataTextField = "SubjectName"; DropDownList4.DataValueField = "SID"; DropDownList4.DataBind(); DropDownList4.Items.Insert(0, "Select Subject"); con.Close(); } catch (Exception ex) { Label1.Text = "Before selecting Year you must select Teacher and Course field."; Label1.ForeColor = System.Drawing.Color.Red; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { MultiView1.SetActiveView(View1); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select max(fault_id)from fault_prediction"; id = db.max_id(cmd); cmd.CommandText = "select mechine_id,mechine_name from mechine_management"; DropDownList1.DataSource = db.getData(cmd); DropDownList1.DataValueField = "mechine_id"; DropDownList1.DataTextField = "mechine_name"; DropDownList1.DataBind(); DropDownList1.Items.Insert(0, "select"); cmd.CommandText = "select employee_id,employee_name from employee_management where emptype='worker'"; DropDownList4.DataSource = db.getData(cmd); DropDownList4.DataValueField = "employee_id"; DropDownList4.DataTextField = "employee_name"; DropDownList4.DataBind(); DropDownList4.Items.Insert(0, "select"); cmd.CommandText = "select employee_id,employee_name from employee_management where emptype='technician'"; DropDownList3.DataSource = db.getData(cmd); DropDownList3.DataValueField = "employee_id"; DropDownList3.DataTextField = "employee_name"; DropDownList3.DataBind(); DropDownList3.Items.Insert(0, "select"); cmd.CommandText = "select * from fault_prediction"; DataGrid1.DataSource = db.getData(cmd); DataGrid1.DataBind(); } }