private void BindDropDownList6() { DataSet ds = new DataSet(); DatabaseHelper DbQuery = new DatabaseHelper(); DataTable dt = new DataTable(); DataRow ndr = dt.NewRow(); dt.Columns.Add("NA002", typeof(String)); dt.Columns.Add("NA003", typeof(String)); string connectionString = ConfigurationManager.ConnectionStrings["ERPconnectionstring"].ToString(); using (SqlConnection conn = new SqlConnection(connectionString)) { SqlCommand command = new SqlCommand(@"SELECT LTRIM(RTRIM(NA002)) AS NA002,NA003 FROM [TK].dbo.CMSNA WHERE COMPANY='TK' AND NA001='2' ORDER BY NA002", conn); ds.Clear(); SqlDataAdapter adapter = new SqlDataAdapter(command); conn.Open(); adapter.Fill(ds, command.ToString()); if (ds.Tables[0].Rows.Count > 0) { DropDownList6.DataSource = ds.Tables[0]; DropDownList6.DataTextField = "NA003"; DropDownList6.DataValueField = "NA002"; DropDownList6.DataBind(); } else { } } }
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { cnn.Open(); DropDownList3.Items.Clear(); SqlCommand cmd = new SqlCommand("select Subject from sub where Ptype='" + DropDownList1.SelectedItem.ToString() + "'", cnn); SqlDataReader dr = cmd.ExecuteReader(); dr.Read(); DataTable dt = new DataTable("sub"); dt.Load(dr); DropDownList3.DataSource = dt; DropDownList3.DataTextField = "Subject"; DropDownList3.DataBind(); DropDownList4.DataSource = dt; DropDownList4.DataTextField = "Subject"; DropDownList4.DataBind(); DropDownList5.DataSource = dt; DropDownList5.DataTextField = "Subject"; DropDownList5.DataBind(); DropDownList6.DataSource = dt; DropDownList6.DataTextField = "Subject"; DropDownList6.DataBind(); DropDownList7.DataSource = dt; DropDownList7.DataTextField = "Subject"; DropDownList7.DataBind(); DropDownList8.DataSource = dt; DropDownList8.DataTextField = "Subject"; DropDownList8.DataBind(); dr.Close(); }
protected void insertcity_Click(object sender, EventArgs e) { if ((TextBox1.Text != "")) { int t = controllerObj.insertcity(TextBox1.Text, Convert.ToInt32(DropDownList6.SelectedValue)); if (t == 0) { Label1.Text = "this city is already exist ."; } else { Label1.Text = "this city inserts corectly ."; } DropDownList7.DataBind(); DropDownList6.DataBind(); DropDownList5.DataBind(); DropDownList4.DataBind(); DropDownList3.DataBind(); DropDownList2.DataBind(); // to make change which happens when delete and insert apeare in other droplists DropDownList11.DataBind(); DropDownList12.DataBind(); DropDownList13.DataBind(); } else { Label1.Text = "You enter missing data !!."; } }
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { string str = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["constring"].ToString(); SqlConnection conn = new SqlConnection(str); SqlDataAdapter sda = new SqlDataAdapter(" select sensor.sensorName,sensor.stationId from sensor,station where sensor.stationId= station.id and station.stationName = '" + DropDownList1.SelectedItem + "' ", conn); DataSet ds = new DataSet(); sda.Fill(ds); DropDownList3.DataTextField = "sensorName"; // DropDownList2.DataValueField = "stationId"; DropDownList3.DataSource = ds.Tables[0].DefaultView; DropDownList3.DataBind(); DropDownList4.DataTextField = "sensorName"; // DropDownList2.DataValueField = "stationId"; DropDownList4.DataSource = ds.Tables[0].DefaultView; DropDownList4.DataBind(); DropDownList5.DataTextField = "sensorName"; // DropDownList2.DataValueField = "stationId"; DropDownList5.DataSource = ds.Tables[0].DefaultView; DropDownList5.DataBind(); DropDownList6.DataTextField = "sensorName"; // DropDownList2.DataValueField = "stationId"; DropDownList6.DataSource = ds.Tables[0].DefaultView; DropDownList6.DataBind(); DropDownList7.DataTextField = "sensorName"; // DropDownList2.DataValueField = "stationId"; DropDownList7.DataSource = ds.Tables[0].DefaultView; DropDownList7.DataBind(); }
private void BindAreaDP() { List <RSSMWeb.Code.Utils.CustomClass> mylist = Utils.GetUserList(); RSSMWeb.Code.Utils.CustomClass tmp = new RSSMWeb.Code.Utils.CustomClass("0", "无", "0"); List <RSSMWeb.Code.Utils.CustomClassForDropdownlist> mylist_username_dpt = Utils.GetUserListForDropdownlist_dpt(); mylist.Insert(0, tmp); DropDownList7.EnableSimulateTree = true; DropDownList7.DataTextField = "Name"; DropDownList7.DataValueField = "ID"; DropDownList7.DataSource = mylist; DropDownList7.DataSimulateTreeLevelField = "Group"; DropDownList7.DataEnableSelectField = "Enableselect"; DropDownList7.DataSource = mylist_username_dpt; DropDownList7.DataBind(); DropDownList7.SelectedValue = "0"; DropDownList6.EnableSimulateTree = true; DropDownList6.DataTextField = "Name"; DropDownList6.DataValueField = "ID"; DropDownList6.DataSimulateTreeLevelField = "Group"; DropDownList6.DataEnableSelectField = "Enableselect"; DropDownList6.DataSource = mylist_username_dpt; DropDownList6.DataBind(); DropDownList6.SelectedValue = "0"; }
protected void Button5_Click(object sender, EventArgs e) { if (TextBox11.Text.Length == 0 || TextBox12.Text.Length == 0) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Δεν έχει συμπληρωθεί το Γραμμάτιο ή το Έτος !!!!');", true); } else { if (TextBox5.Text.Length == 0 || TextBox6.Text.Length == 0) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Δεν έχει συμπληρωθεί η Ημεριμηνία του Εγγράφου ή ο Αριθμός Πρωτοκόλλου (ΑΣ) !!!!');", true); } else { if (DropDownList4.SelectedValue.Length == 0) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Δεν έχει συμπληρωθεί ο Υπογράφων !!!!');", true); } else { Diav_Gram_Eisp.Insert(); DropDownList6.DataBind(); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { lanrepo = new LanguageRepository(); qualrepo = new QualityRepository(); genrepo = new GenreRepository(); List <LanguageTable> lan = lanrepo.GetAllLanguages(); List <GenreTable> gen = genrepo.GetAllGenres(); List <QualityTable> qual = qualrepo.GetAllQualities(); DropDownList6.DataSource = lan; DropDownList6.DataTextField = "LanguageName"; DropDownList6.DataValueField = "LanguageID"; DropDownList6.DataBind(); DropDownList7.DataSource = qual; DropDownList7.DataTextField = "QualityName"; DropDownList7.DataValueField = "QualityID"; DropDownList7.DataBind(); DropDownList8.DataSource = gen; DropDownList8.DataTextField = "GenreName"; DropDownList8.DataValueField = "GenreID"; DropDownList8.DataBind(); } }
private void BindDropDownList6() { DataTable dt = new DataTable(); dt.Columns.Add("KINDS", typeof(String)); string connectionString = ConfigurationManager.ConnectionStrings["ERPconnectionstring"].ToString(); Ede.Uof.Utility.Data.DatabaseHelper m_db = new Ede.Uof.Utility.Data.DatabaseHelper(connectionString); string cmdTxt = @"SELECT [ID],[KINDS] FROM [TKBUSINESS].[dbo].[TBSALESKINDS] ORDER BY [ID]"; dt.Load(m_db.ExecuteReader(cmdTxt)); if (dt.Rows.Count > 0) { DropDownList6.DataSource = dt; DropDownList6.DataTextField = "KINDS"; DropDownList6.DataValueField = "KINDS"; DropDownList6.DataBind(); } else { } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var x = Request.QueryString["id"].ToString(); int y = int.Parse(x); HyperLink1.NavigateUrl = "ProfAddQuestion.aspx?id=" + x; HyperLink2.NavigateUrl = "ProfEditChapters.aspx?id=" + x; HyperLink3.NavigateUrl = "ProfEditQuestion.aspx?id=" + x; HyperLink4.NavigateUrl = "ProfAddChapters.aspx?id=" + x; HyperLink6.NavigateUrl = "ProfShowResult.aspx?id=" + x; HyperLink7.NavigateUrl = "ProfExamStructure.aspx?id=" + x; var stateid = from Tbl_Subject in db.Tbl_Subject where Tbl_Subject.Prof_ID.Equals(y) select new { Tbl_Subject.Subject_ID, Tbl_Subject.Name_Er, Tbl_Subject.Name_Ar }; var statename = stateid.ToList(); if (statename.Count > 0) { DropDownList1.DataValueField = "Subject_ID"; DropDownList1.DataTextField = "Name_Er"; DropDownList1.DataSource = statename; DropDownList1.DataBind(); DropDownList1.Items.Insert(0, "--- select sub----"); DropDownList6.DataValueField = "Subject_ID"; DropDownList6.DataTextField = "Name_Ar"; DropDownList6.DataSource = statename; DropDownList6.DataBind(); DropDownList6.Items.Insert(0, "--- أختر المادة----"); } } }
protected void insertcountry_Click(object sender, EventArgs e) { if (TextBox2.Text != "") { int t = controllerObj.insertcountry(TextBox2.Text); if (t == 0) { Label2.Text = "this country is already exist ."; } else { Label2.Text = "this country inserts corectly ."; } DropDownList7.DataBind(); DropDownList6.DataBind(); DropDownList5.DataBind(); DropDownList4.DataBind(); DropDownList3.DataBind(); DropDownList2.DataBind(); DropDownList11.DataBind(); DropDownList12.DataBind(); DropDownList13.DataBind(); } else { Label2.Text = "You enter missing data !!."; } }
protected void Button6_Click(object sender, EventArgs e) { Asignaturas ObjAsignatura = new Asignaturas(); try { ObjAsignatura.Nombre = DropDownList3.Text; bool RespuestaSql = ObjAsignatura.EliminarAsignatura(); if (RespuestaSql == true) { GridView1.Visible = false; DropDownList3.DataBind(); DropDownList6.DataBind(); DropDownList5.DataBind(); DropDownList4.DataBind(); MessageBox.alert("Se ha borrado la asignatura correctamente"); TextBox1.Text = ""; } else { MessageBox.alert(ObjAsignatura.Mensaje); } } catch (Exception Ex) { MessageBox.alert("Error!: " + Ex.Message + " " + ObjAsignatura.Mensaje); } }
private void dataProject(String project_id) { DataTable dt6 = TaskSystem.tools.GetData("SELECT [id], [version] FROM [project_version] WHERE [status]='released' AND [project_id]='" + project_id + "' ORDER BY [id]"); DropDownList5.Items.Clear(); DropDownList5.DataTextField = "version"; DropDownList5.DataValueField = "id"; DropDownList5.DataSource = dt6; if (dt6.Rows.Count > 0) { DropDownList5.DataBind(); } DropDownList5.Items.Insert(0, new ListItem("", "")); DataTable dt7 = TaskSystem.tools.GetData("SELECT [id], [version] FROM [project_version] WHERE [status]='open' AND [project_id]='" + project_id + "' ORDER BY [id]"); DropDownList6.Items.Clear(); DropDownList6.DataTextField = "version"; DropDownList6.DataValueField = "id"; if (dt6 != null) { if (dt6.Rows.Count > 0) { DropDownList6.DataSource = dt7; DropDownList6.DataBind(); } } DropDownList6.Items.Insert(0, new ListItem("", "")); }
private void BindDropDown11() { try { using (OracleConnection sqlConn = new OracleConnection(strConn)) { using (OracleCommand sqlCmd = new OracleCommand()) { sqlCmd.CommandText = "select * from TB_POSITION"; sqlCmd.Connection = sqlConn; sqlConn.Open(); OracleDataAdapter da = new OracleDataAdapter(sqlCmd); DataTable dt = new DataTable(); da.Fill(dt); DropDownList11.DataSource = dt; DropDownList11.DataValueField = "ID"; DropDownList11.DataTextField = "NAME"; DropDownList11.DataBind(); DropDownList6.DataSource = dt; DropDownList6.DataValueField = "ID"; DropDownList6.DataTextField = "NAME"; DropDownList6.DataBind(); sqlConn.Close(); DropDownList11.Items.Insert(0, new ListItem("-- กรุณาเลือก --", "0")); DropDownList6.Items.Insert(0, new ListItem("-- กรุณาเลือก --", "0")); } } } catch { } }
protected void DropDownList5_SelectedIndexChanged(object sender, EventArgs e) { try { string DBHost = "127.0.0.1"; string DBName = "bibledb"; string DBUserName = "******"; string DBPassword = "******"; string Conn_String = "server=" + DBHost + ";uid=" + DBUserName + ";password="******";database=" + DBName + ";"; MySqlConnection Conn = new MySqlConnection(Conn_String); Conn.Open(); x = DropDownList5.SelectedValue.ToString(); MySqlCommand cmd; cmd = new MySqlCommand("select distinct chapternum from bibledb.nivdb where book='" + x + "'", Conn); cmd.CommandType = CommandType.Text; Label1.Text = x; MySqlDataReader ddlValues; ddlValues = cmd.ExecuteReader(); DropDownList6.DataSource = ddlValues; DropDownList6.DataTextField = "chapternum"; // DropDownList1.DataValueField = "id"; DropDownList6.DataBind(); Conn.Close(); } catch (Exception ex) { } }
protected void Button2_Click(object sender, EventArgs e) { Areas ObjArea = new Areas(); try { bool RespuestaSql = ObjArea.ModificarArea(DropDownList4.Text, TextBox2.Text); if (RespuestaSql == true) { DropDownList3.DataBind(); DropDownList6.DataBind(); DropDownList5.DataBind(); DropDownList4.DataBind(); MessageBox.alert("Se ha modificado el area con exito"); GridView1.Visible = false; TextBox2.Text = ""; } else { MessageBox.alert(ObjArea.Mensaje); } } catch (Exception Ex) { MessageBox.alert("Error!: " + Ex.Message + " " + ObjArea.Mensaje); } }
protected void DropDownList4_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='" + DropDownList4.SelectedItem.Value + "' and Com_Id='" + company_id + "'", con); con.Open(); DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(ds); DropDownList6.DataSource = ds; DropDownList6.DataTextField = "subcategoryname"; DropDownList6.DataValueField = "subcategory_id"; DropDownList6.DataBind(); DropDownList6.Items.Insert(0, new ListItem("All", "0")); con.Close(); ModalPopupExtender3.Show(); }
protected void Page_Load(object sender, EventArgs e) { if (con.State == ConnectionState.Open) { con.Close(); } if (!Page.IsPostBack) { con.Open(); SqlCommand cmd = con.CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "Select *from person where type='Student'"; DropDownList1.DataSource = cmd.ExecuteReader(); DropDownList1.DataBind(); DropDownList1.Items.Insert(0, new ListItem("--Select--", "0")); con.Close(); con.Open(); cmd.CommandType = CommandType.Text; cmd.CommandText = "Select *from person where type='Student'"; DropDownList2.DataSource = cmd.ExecuteReader(); DropDownList2.DataBind(); DropDownList2.Items.Insert(0, new ListItem("--Select--", "0")); con.Close(); con.Open(); cmd.CommandType = CommandType.Text; cmd.CommandText = "Select *from person where type='Student'"; DropDownList3.DataSource = cmd.ExecuteReader(); DropDownList3.DataBind(); DropDownList3.Items.Insert(0, new ListItem("--Select--", "0")); con.Close(); con.Open(); cmd.CommandType = CommandType.Text; cmd.CommandText = "Select *from person where type='Student'"; DropDownList4.DataSource = cmd.ExecuteReader(); DropDownList4.DataBind(); DropDownList4.Items.Insert(0, new ListItem("--Select--", "0")); con.Close(); con.Open(); cmd.CommandType = CommandType.Text; cmd.CommandText = "Select *from projects"; DropDownList5.DataSource = cmd.ExecuteReader(); DropDownList5.DataBind(); DropDownList5.Items.Insert(0, new ListItem("--Select--", "0")); con.Close(); con.Open(); cmd.CommandType = CommandType.Text; cmd.CommandText = "Select *from person where type='Teacher'"; DropDownList6.DataSource = cmd.ExecuteReader(); DropDownList6.DataBind(); DropDownList6.Items.Insert(0, new ListItem("--Select--", "0")); con.Close(); } }
protected void Button14_Click(object sender, EventArgs e) { int dt = controllerObj.DeleteHOTEL(DropDownList6.Text.ToString()); DropDownList6.DataBind(); DropDownList7.DataBind(); DropDownList8.DataBind(); }
protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e) { ABET_Sub_Cat.DataBind(); DropDownList6.Items.Clear(); DropDownList6.Items.Add(new ListItem(" Υποκ. Πράξεων (Όλες)...", "0")); DropDownList6.DataBind(); Reservations.DataBind(); GridView3.DataBind(); }
public void drop6() { ds.Clear(); ds = db.discont("select distinct role from tb_subroles_of_subrole "); DropDownList6.DataSource = ds; DropDownList6.DataTextField = "role"; DropDownList6.DataBind(); DropDownList6.Items.Insert(0, "Select Role............"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SqlCommand cmd = new SqlCommand("Select distinct trip_id from Trip where boarding_point = '" + Session["board"] + "' and arrival_point = '" + Session["arrive"] + "'", con); con.Open(); DropDownList10.DataSource = cmd.ExecuteReader(); DropDownList10.DataTextField = "trip_id"; DropDownList10.DataValueField = "trip_id"; DropDownList10.DataBind(); Session["trips"] = DropDownList10.SelectedValue.ToString(); con.Close(); } if (!IsPostBack) { SqlCommand cmd = new SqlCommand("Select distinct bus_id from Bus", con); con.Open(); DropDownList6.DataSource = cmd.ExecuteReader(); DropDownList6.DataTextField = "bus_id"; DropDownList6.DataValueField = "bus_id"; DropDownList6.DataBind(); con.Close(); } if (!IsPostBack) { SqlCommand cmd = new SqlCommand("Select distinct * from Bus_Company", con); con.Open(); DropDownList11.DataSource = cmd.ExecuteReader(); DropDownList11.DataTextField = "company_name"; DropDownList11.DataValueField = "buscomponay_id"; DropDownList11.DataBind(); con.Close(); } }
private void dataProject() { DataTable dt = TaskSystem.tools.GetData("SELECT [id], [project] FROM [project] ORDER BY [id]"); DropDownList1.DataTextField = "project"; DropDownList1.DataValueField = "id"; DropDownList1.DataSource = dt; DropDownList1.DataBind(); DataTable dt2 = TaskSystem.tools.GetData("SELECT [id], [username] FROM [users] ORDER BY [id]"); DropDownList7.DataTextField = "username"; DropDownList7.DataValueField = "id"; DropDownList7.DataSource = dt2; DropDownList7.DataBind(); DataTable dt3 = TaskSystem.tools.GetData("SELECT [id], [name] FROM [type] ORDER BY [id]"); DropDownList2.DataTextField = "name"; DropDownList2.DataValueField = "id"; DropDownList2.DataSource = dt3; DropDownList2.DataBind(); DataTable dt4 = TaskSystem.tools.GetData("SELECT [id], [name] FROM [priority] ORDER BY [id]"); DropDownList3.DataTextField = "name"; DropDownList3.DataValueField = "id"; DropDownList3.DataSource = dt4; DropDownList3.DataBind(); DataTable dt5 = TaskSystem.tools.GetData("SELECT [id], [name] FROM [sprint] WHERE status='open' OR sprint.status='active' ORDER BY [id]"); DropDownList4.DataTextField = "name"; DropDownList4.DataValueField = "id"; DropDownList4.DataSource = dt5; DropDownList4.DataBind(); DataTable dt6 = TaskSystem.tools.GetData("SELECT [id], [version] FROM [project_version] WHERE [status]='released' ORDER BY [id]"); DropDownList5.Items.Clear(); DropDownList5.DataTextField = "version"; DropDownList5.DataValueField = "id"; DropDownList5.DataSource = dt6; DropDownList5.DataBind(); DropDownList5.Items.Insert(0, new ListItem("", "")); DataTable dt7 = TaskSystem.tools.GetData("SELECT [id], [version] FROM [project_version] WHERE [status]='open' ORDER BY [id]"); DropDownList6.Items.Clear(); DropDownList6.DataTextField = "version"; DropDownList6.DataValueField = "id"; DropDownList6.DataSource = dt7; DropDownList6.DataBind(); DropDownList6.Items.Insert(0, new ListItem("", "")); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { txtEstimateStartDate.SelectedDate = Convert.ToDateTime(DateTime.Now.AddDays(-7).ToString("yyyy/MM/dd")); txtEstimateEndDate.SelectedDate = Convert.ToDateTime(DateTime.Now.AddDays(+0).ToString("yyyy/MM/dd")); sql_temp = "select distinct(t.type_name) as type_name from lh_onduty_record t"; ds_temp = func.get_dataSet_access(sql_temp, conn); DropDownList1.DataTextField = "type_name"; DropDownList1.DataValueField = "type_name"; DropDownList1.DataSource = ds_temp.Tables[0]; DropDownList1.DataBind(); DropDownList1.Items.Insert(0, "請選擇"); ds_temp.Clear(); sql_temp = "select distinct(t.buname) as buname from lh_onduty_record t"; ds_temp = func.get_dataSet_access(sql_temp, conn); DropDownList3.DataTextField = "buname"; DropDownList3.DataValueField = "buname"; DropDownList3.DataSource = ds_temp.Tables[0]; DropDownList3.DataBind(); DropDownList3.Items.Insert(0, "請選擇"); ds_temp.Clear(); arlist_temp1 = func.FileToArray(Server.MapPath(".") + "\\config\\lh_category.txt"); DropDownList6.DataSource = arlist_temp1; DropDownList6.DataBind(); DropDownList12.DataSource = ""; DropDownList12.DataBind(); DropDownList12.Items.Insert(0, "請選擇"); DropDownList4.DataSource = ""; DropDownList4.Items.Insert(0, "請選擇"); arlist_temp1 = func.FileToArray(Server.MapPath(".") + "\\config\\flag_type_query.txt"); DropDownList2.DataSource = arlist_temp1; DropDownList2.DataBind(); DropDownList2.Items.Insert(0, "請選擇"); bind_data(); } }
protected void Button11_Click(object sender, EventArgs e) { Dnsi.Insert(); Dnsi.DataBind(); DropDownList3.DataBind(); DropDownList4.DataBind(); DropDownList5.DataBind(); DropDownList6.DataBind(); DropDownList7.DataBind(); DropDownList8.DataBind(); TextBox4.Text = ""; }
protected void Button7_Click(object sender, EventArgs e) { Areas ObjArea = new Areas(); try { ObjArea.Nombre = DropDownList4.Text; bool RespuestaSql = ObjArea.EliminarArea(); if (RespuestaSql == true) { DropDownList3.DataBind(); DropDownList6.DataBind(); DropDownList5.DataBind(); DropDownList4.DataBind(); MessageBox.alert("Se ha borrado el area correctamente"); TextBox2.Text = ""; } else { MessageBox.alert("Borra o cambia de areas las asignaturas que se muestran en la tabla para poder eliminar el area"); Asignaturas ObjAsignatura = new Asignaturas(); try { DataSet DatosAsignatura = ObjAsignatura.ConsultarAsignaturaAreaTodos2(DropDownList4.Text); DataTable DatosConsultados = DatosAsignatura.Tables["DatosConsultados"]; int numregistros = DatosConsultados.Rows.Count; if (numregistros == 0) { MessageBox.alert("No hay asignaturas en la base de datos"); } else { GridView1.Visible = true; GridView1.DataSource = DatosConsultados; GridView1.DataBind(); } } catch (Exception Ex) { MessageBox.alert("Error!: " + Ex.Message + " " + ObjAsignatura.Mensaje); } } } catch (Exception Ex) { MessageBox.alert("Error!: " + Ex.Message + " " + ObjArea.Mensaje); } }
protected void DropDownList5_SelectedIndexChanged(object sender, EventArgs e) { SqlDataAdapter adp = new SqlDataAdapter("select * from Food_Registions where Mall_Name='" + DropDownList5.SelectedValue.ToString() + "'", con); DataSet ds = new DataSet(); adp.Fill(ds); DropDownList6.DataSource = ds; DropDownList6.DataValueField = "Shop_Name"; DropDownList6.DataTextField = "Shop_Name"; DropDownList6.DataBind(); DropDownList6.Items.Insert(0, "select ShopName"); }
protected void delcity_Click(object sender, EventArgs e) { controllerObj.deletecity(Convert.ToInt32(DropDownList12.SelectedValue)); DropDownList7.DataBind(); DropDownList6.DataBind(); DropDownList5.DataBind(); DropDownList4.DataBind(); DropDownList3.DataBind(); DropDownList2.DataBind(); DropDownList11.DataBind(); DropDownList12.DataBind(); DropDownList13.DataBind(); }
protected void Button7_Click(object sender, EventArgs e) { string conexao = @"Server=Localhost;Database=Consultorio;Trusted_Connection=true"; SqlConnection conecta = new SqlConnection(conexao); conecta.Open(); SqlCommand acha = new SqlCommand("select distinct DtConsulta,Dia_Consulta from Paciente_Clinica_Ilha where DtConsulta='" + DropDownList1.Text + "'", conecta); DropDownList6.DataTextField = "Dia_Consulta"; DropDownList6.DataValueField = "Dia_Consulta"; DropDownList6.DataSource = acha.ExecuteReader(); DropDownList6.DataBind(); }
protected void Button6_Click(object sender, EventArgs e) { string conexao = @"Server=Localhost;Database=Consultorio;Trusted_Connection=true"; SqlConnection conecta1 = new SqlConnection(conexao); conecta1.Open(); SqlCommand acha = new SqlCommand("select mes,data from datatijuca where mes='" + DropDownList5.Text + "'", conecta1); DropDownList6.DataTextField = "data"; DropDownList6.DataValueField = "data"; DropDownList6.DataSource = acha.ExecuteReader(); DropDownList6.DataBind(); }
private void dept() { SqlCommand cmd = new SqlCommand("prc_dispdeptdet", con); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader rd = cmd.ExecuteReader(); DropDownList6.DataTextField = "department"; DropDownList6.DataValueField = "deptid"; DropDownList6.DataSource = rd; DropDownList6.DataBind(); rd.Close(); cmd.Dispose(); }