示例#1
0
        public void Run()
        {
            _Console.WriteLine("End statement with ';'");
            _Console.WriteLine("Enter 'quit' when done");
            _Console.WriteLine();

            string line;
            string statement = "";
            _Console.Write(">");
            while((line = _Console.ReadLine()) != "quit") {
                statement += line + '\n';
                if(!line.Trim().EndsWith(";"))
                    continue;

                using(var db = new Db()) {
                    try {
                        db.ExecuteReader(statement, PrintHeader,PrintGrid);
                    } catch(Exception e) {
                        _Console.WriteLine(e.Message);
                    }
                }
                statement = "";
                _Console.Write(">");
            }
        }