AddColumn() public method

public AddColumn ( string s ) : Query
s string
return Query
 // tag::printDepartmentEmployees[]
 public static void PrintDepartmentEmployees(string department) {
     Query q = new Query();
     foreach (Employee e in q.AddColumn("FamilyName")
         .AddColumn("Initials")
         .AddColumn("GivenName")
         .AddColumn("AddressLine1")
         .AddColumn("ZIPcode")
         .AddColumn("City")
         .AddTable("EMPLOYEES")
         .AddWhere("EmployeeDep='" + department + "'")
         .Execute()) {
         Console.WriteLine("<div name='addressDiv'" + e.FamilyName
             + ", " + e.Initials + "<br />" + e.AddressLine1
             + "<br />" + e.ZipCode + e.City + "</div>");
     }
 }
 // tag::printDepartmentEmployees[]
 public static void PrintDepartmentEmployees(string department)
 {
     Query q = new Query();
     foreach (Employee e in q.AddColumn("FamilyName")
         .AddColumn("Initials")
         .AddColumn("GivenName")
         .AddColumn("AddressLine1")
         .AddColumn("ZIPcode")
         .AddColumn("City")
         .AddTable("EMPLOYEES")
         .AddWhere($"EmployeeDep='{department}'")
         .Execute())
     {
         Console.WriteLine($@"<div name='addressDiv'>
             {e.FamilyName}, {e.Initials}<br />" +
             "{e.AddressLine1}<br />{e.ZipCode}{e.City}</div>");
     }
 }
示例#3
0
        // tag::printDepartmentEmployees[]
        public static void PrintDepartmentEmployees(string department)
        {
            Query q = new Query();

            foreach (Employee e in q.AddColumn("FamilyName")
                     .AddColumn("Initials")
                     .AddColumn("GivenName")
                     .AddColumn("AddressLine1")
                     .AddColumn("ZIPcode")
                     .AddColumn("City")
                     .AddTable("EMPLOYEES")
                     .AddWhere($"EmployeeDep='{department}'")
                     .Execute())
            {
                Console.WriteLine($@"<div name='addressDiv'>
                    {e.FamilyName}, {e.Initials}<br />" +
                                  "{e.AddressLine1}<br />{e.ZipCode}{e.City}</div>");
            }
        }
        // tag::printDepartmentEmployees[]
        public static void PrintDepartmentEmployees(string department)
        {
            Query q = new Query();

            foreach (Employee e in q.AddColumn("FamilyName")
                     .AddColumn("Initials")
                     .AddColumn("GivenName")
                     .AddColumn("AddressLine1")
                     .AddColumn("ZIPcode")
                     .AddColumn("City")
                     .AddTable("EMPLOYEES")
                     .AddWhere("EmployeeDep='" + department + "'")
                     .Execute())
            {
                Console.WriteLine("<div name='addressDiv'" + e.FamilyName
                                  + ", " + e.Initials + "<br />" + e.AddressLine1
                                  + "<br />" + e.ZipCode + e.City + "</div>");
            }
        }