internal static DataTable getDataTableData(DbConnection con, string sql) { var data = new DataTable(); try { using (var adapter = new DbAdapterFactory(con, sql).Create()) { try { adapter.Fill(data); Terminal.MainTerminal.AppendText(sql); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } } } catch (DbException ex) { Terminal.MainTerminal.AppendText(ex.Message); #if DEBUG Console.WriteLine(ex.Message); #endif } return(data); }
internal static DataTable getDataTableData(DbConnection con, string sql) { var data = new DataTable(); using (var adapter = new DbAdapterFactory(con, sql).Create()) { try { adapter.Fill(data); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } } return(data); }