Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }