Beispiel #1
0
 private void CmBTables2_SelectedValueChanged(object sender, EventArgs e)
 {
     CmbColums2.DataSource = SchemaTables.GetAllColumFromTable(Constants.CONECTION_STRING, Constants.DB_NAME, CmBTables2?.SelectedValue?.ToString());
     if (IsChargeForm)
     {
         NotifyConditon.ChangeValueItem(Identifier, GenerateQuery(), CheckAND.Checked ? "AND" : "OR");
     }
 }
Beispiel #2
0
        private void BtnSearch_Click(object sender, EventArgs e)
        {
            PnlNortificationType.Controls.Clear();
            String query = String.Concat("SELECT * FROM ", CmbDestination.SelectedValue.ToString(), " WHERE ");

            List <String> listRowsTables = SchemaTables.GetAllColumFromTable(Constants.CONECTION_STRING, Constants.DB_NAME, CmbDestination.SelectedValue.ToString());

            foreach (String item in listRowsTables)
            {
                query = String.Concat(query, "(", item, " LIKE '%", TxtSearch.Text, "%') ");
                if (listRowsTables.IndexOf(item) != listRowsTables.Count - 1)
                {
                    query = String.Concat(query, " OR ");
                }
            }
            GrdViewResult.DataSource = SchemaTables.ExeucteQuery(Constants.CONECTION_STRING, query, this);
        }