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"); } }
public void RefreshDatabase() { SelectedDatabase?.Refresh(); }
public TMContext GetNewContext() { return(SelectedDatabase.GetNewContext()); }