Index: /branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Command/Aggregation/AggregateCommandBase.cs
===================================================================
--- /branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Command/Aggregation/AggregateCommandBase.cs	(revision 7624)
+++ /branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Command/Aggregation/AggregateCommandBase.cs	(revision 7625)
@@ -74,4 +74,5 @@
     public override void Execute() {
       base.Execute();
+      if (!ColumnGroup.Columns.Any()) return;
       if (!ColumnGroup.Sorted)
         throw new CommandExecutionException("ColumnGroup must be sorted to use aggregation commands.", this);
Index: /branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Command/Aggregation/DeleteRowsWithDuplicateKeyValuesCommand.cs
===================================================================
--- /branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Command/Aggregation/DeleteRowsWithDuplicateKeyValuesCommand.cs	(revision 7624)
+++ /branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Command/Aggregation/DeleteRowsWithDuplicateKeyValuesCommand.cs	(revision 7625)
@@ -50,4 +50,5 @@
     public override void Execute() {
       base.Execute();
+      if (!ColumnGroup.Columns.Any()) return;
       if (!ColumnGroup.Sorted)
         throw new CommandExecutionException("ColumnGroup must be sorted to delete rows with duplicate key.", this);
Index: /branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Command/ChangeDataset/AlignColumnGroupsCommand.cs
===================================================================
--- /branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Command/ChangeDataset/AlignColumnGroupsCommand.cs	(revision 7624)
+++ /branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Command/ChangeDataset/AlignColumnGroupsCommand.cs	(revision 7625)
@@ -56,4 +56,6 @@
       this.removePos2 = this.DataSet.IndexOfColumnGroup(oldColumnGroup2);
 
+      if (!oldColumnGroup1.Columns.Any() || !oldColumnGroup2.Columns.Any()) return;
+
       if (oldColumnGroup1.SortedColumnsCount < 1 || oldColumnGroup1.SortedColumnsCount != oldColumnGroup2.SortedColumnsCount)
         throw new CommandExecutionException("Both ColumnGroups must be sorted by at least one column and must be sorted by the same number of columns.", this);
@@ -64,5 +66,5 @@
         if (this.oldColumnGroup1.Columns.ElementAt(oldColumnGroup1.SortedColumnIndexes.ElementAt(i)).DataType !=
             this.oldColumnGroup2.Columns.ElementAt(oldColumnGroup2.SortedColumnIndexes.ElementAt(i)).DataType)
-          throw new CommandExecutionException("Both ColumnGroups must be sorted by columns of the same type",this);
+          throw new CommandExecutionException("Both ColumnGroups must be sorted by columns of the same type", this);
       }
 
Index: /branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Data/Command/DeleteColumnCommand.cs
===================================================================
--- /branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Data/Command/DeleteColumnCommand.cs	(revision 7624)
+++ /branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Data/Command/DeleteColumnCommand.cs	(revision 7625)
@@ -48,4 +48,6 @@
       base.Execute();
       this.oldSortedColumnIndices = new List<int>(ColumnGroup.SortedColumnIndexes);
+      if (!ColumnGroup.Columns.Any()) return;
+
       ColumnBase column;
       foreach (int columnIndex in AffectedColumns.Reverse()) {
@@ -62,5 +64,5 @@
     public override void UndoExecute() {
       base.UndoExecute();
-      for (int i = 0; i < AffectedColumns.Length; i++)
+      for (int i = 0; i < deletedColumns.Count; i++)
         ColumnGroup.InsertColumn(AffectedColumns[i], deletedColumns[i]);
 
Index: /branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.DbExplorer.Interfaces/DbExplorerBase.cs
===================================================================
--- /branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.DbExplorer.Interfaces/DbExplorerBase.cs	(revision 7624)
+++ /branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.DbExplorer.Interfaces/DbExplorerBase.cs	(revision 7625)
@@ -101,5 +101,5 @@
               filterColumns.Add(col);
             }
-          cmdText += "count(*) from " + EscapeSqlString(table.OwnerName )+ "." + EscapeSqlString(table.TableName);
+          cmdText += "count(*) from " + EscapeSqlString(table.OwnerName) + "." + EscapeSqlString(table.TableName);
           cmd.CommandText = cmdText;
 
@@ -222,12 +222,16 @@
               //fill columns with values
               for (int i = 0; i < reader.FieldCount; i++) {
-                if (reader.IsDBNull(i))
+                if (reader.IsDBNull(i)) {
                   columnGroup.Columns.ElementAt(i).AddValue(null);
-                else if (columnGroup.Columns.ElementAt(i).DataType == typeof(double?))
-                  columnGroup.Columns.ElementAt(i).AddValue(Convert.ToDouble(reader.GetValue(i)));
-                else if (columnGroup.Columns.ElementAt(i).DataType == typeof(DateTime?))
-                  columnGroup.Columns.ElementAt(i).AddValue(reader.GetDateTime(i));
-                else
-                  columnGroup.Columns.ElementAt(i).AddValue(reader.GetValue(i).ToString());
+                } else if (columnGroup.Columns.ElementAt(i).DataType == typeof(double?)) {
+                  try { columnGroup.Columns.ElementAt(i).AddValue(Convert.ToDouble(reader.GetValue(i))); }
+                  catch (DbException) { columnGroup.Columns.ElementAt(i).AddValue(null); }
+                } else if (columnGroup.Columns.ElementAt(i).DataType == typeof(DateTime?)) {
+                  try { columnGroup.Columns.ElementAt(i).AddValue(reader.GetDateTime(i)); }
+                  catch (DbException) { columnGroup.Columns.ElementAt(i).AddValue(null); }
+                } else {
+                  try { columnGroup.Columns.ElementAt(i).AddValue(reader.GetValue(i).ToString()); }
+                  catch (DbException) { columnGroup.Columns.ElementAt(i).AddValue(null); }
+                }
               }
               actRow++;
@@ -235,4 +239,12 @@
                 FireNewRowLoaded(actRow);
             }
+            if (initColumns) {
+              for (int i = 0; i < reader.FieldCount; i++) {
+                if (reader.GetName(i).ToUpper().Contains("ZEIT"))
+                  columnGroup.AddColumn(new DateTimeColumn(reader.GetName(i)));
+                else
+                  columnGroup.AddColumn(new DoubleColumn(reader.GetName(i)));
+              }
+            }
             reader.Close();
           }  //end using reader
