Dynamic Query

You can construct a query SQL statement to query data from a local database. This query may across multiple tables (MBOs).

Query query2 = new Query();
query2.Select("c.fname,c.lname,s.order_date,s.region");
query2.From("Customer", "c");
//
// Convenience method for adding a join to the query
// Detailed construction of the join criteria
query2.Join("Sales_order", "s", "c.id", "s.cust_id");
AttributeTest ts = new AttributeTest();
ts.Attribute = ("fname");
ts.TestValue = "Beth";
query2.Where(ts);
QueryResultSet resultSet = SampleAppDB.ExecuteQuery(query2);
Note: A wildcard is not allowed in the Select clause. You must use explicit column names.