示例#1
0
        public void TestComplexSelectGetFieldName()
        {
            string expected = "a.dept";

            ComplexSelectStatment select = new ComplexSelectStatment();
            select.AddTable("emp");
            select.AddField("dept", "emp");

            Assert.AreEqual(expected.ToLower(), select.GetSQLFormatFieldName("dept").ToLower());
        }
示例#2
0
        public void TestComplexSelect()
        {
            string expected = "SELECT a.empid, a.name, b.dept";

            ComplexSelectStatment select = new ComplexSelectStatment();
            select.AddTable("emp");
            select.AddTable("dept");
            select.AddField("empid", "emp");
            select.AddField("name", "emp");
            select.AddField("dept", "dept");

            Assert.AreEqual(expected.ToLower(), select.ToString().ToLower());
        }
示例#3
0
        static void Main(string[] args)
        {
            //TestDBAccess();

            //TestComplexClause();
            //TestComplexClauseNoJoin();

            ComplexSelectStatment select = new ComplexSelectStatment();
            select.AddTable("emp");
            select.AddTable("dept");
            select.AddField("empid", "emp");
            select.AddField("name", "emp");
            select.AddField("dept", "dept");
            Console.WriteLine(select.ToString());

            Console.ReadKey();
        }