Ejemplo n.º 1
0
        public static void ToConsole(this DataTable dt, bool vertical = false, bool more = false, bool outputDbNull = true, int maxColumnWidth = 0)
        {
            ShellHistory.SetLastResult(dt);
            OutputDataTable odt = new OutputDataTable(dt, cout.TrimWriteLine, vertical)
            {
                OutputDbNull   = outputDbNull,
                MaxColumnWidth = maxColumnWidth,
            };

            odt.Output();

            cout.WriteLine("<{0}{1} row{2}>", more ? "top " : "", dt.Rows.Count, dt.Rows.Count > 1 ? "s" : "");
        }
Ejemplo n.º 2
0
        private bool Display(ApplicationCommand cmd, SqlBuilder builder, TableName tname, int top)
        {
            try
            {
                DataTable table = builder.SqlCmd.FillDataTable();
                table.SetSchemaAndTableName(tname);
                ShellHistory.SetLastResult(table);

                return(Display(cmd, table, top));
            }
            catch (Exception ex)
            {
                cerr.WriteLine(ex.Message);
                return(false);
            }
        }