Beispiel #1
0
 private void _GetSqlForTable(Smo.Table table)
 {
     try
     {
         NonEmptyCols = $"{NonEmptyCols}{Environment.NewLine}SELECT";
         foreach (Smo.Column col in table.Columns)
         {
             TheData = SelectedDatabase.ExecuteWithResults($"exec SelectColContent '{table.Name}', '{col.Name}'").Tables[0].DefaultView;
             int rowCount = (int)TheData[0][0];
             if (rowCount > 0)
             {
                 NonEmptyCols = $"{NonEmptyCols}{Environment.NewLine}{col.Name},";
             }
         }
         NonEmptyCols = NonEmptyCols.Trim(',');
         NonEmptyCols = $"{NonEmptyCols}{Environment.NewLine}FROM {table.Name}{Environment.NewLine}";
     }
     catch (Exception excp)
     {
         MessageBox.Show(excp.ToString(), "Error happened");
     }
 }
Beispiel #2
0
 public void RefreshDatabase()
 {
     SelectedDatabase?.Refresh();
 }
Beispiel #3
0
 public TMContext GetNewContext()
 {
     return(SelectedDatabase.GetNewContext());
 }