public void Bind_DataList_EMAIL() { var dt = this.conn.GetDataTable("SELECT * FROM VW_ALERT_EMAIL order by TGL_EMAIL asc", null, this.dbtimeout, true, true); if (dt.Rows.Count > 0) { DataList_Email.DataSource = dt; DataList_Email.DataBind(); Lb_Email.Visible = false; } else { DataList_Email.DataSource = dt; DataList_Email.DataBind(); Lb_Email.Visible = true; } }
protected void search_Click(object sender, EventArgs e) { s_unitemail = ddl_UNIT1.SelectedItem.Text; var dt = this.conn.GetDataTable("SELECT * FROM vw_alert_EMAIL where (UNIT = '" + ddl_UNIT1.SelectedValue.ToString() + "' or isnull('" + ddl_UNIT1.SelectedValue.ToString() + "' ,'')='') order by TGL_EMAIL asc", null, this.dbtimeout, true, true); if (dt.Rows.Count > 0) { DataList_Email.DataSource = dt; DataList_Email.DataBind(); Lb_Email.Visible = false; } else { DataList_Email.DataSource = dt; DataList_Email.DataBind(); Lb_Email.Visible = true; } }