var query = @"
from order o
join orderDetail od
on o.order_id = od.order_id ";
var result = scope.GetSqlQuery(query
1 Answer, 1 is accepted
answered on 25 Nov 2009, 08:20 AM
Hello Kwon OhJong,
Since you are doing a projection (combining columns from several tables) it does not make sense to supply a value for the second parameter, you can just pass null. Then the result will be an object array (object) and each element will be an object array itself, containing the values from all selected columns. More information about this method could be found in this help topic.
However, I would suggest you to consider using Linq queries as they are strongly-typed and checked for errors on compile time. To use Joins in Linq queries, you will have to upgrade to a newer version (the latest one is 2009.3 1119). Then you can take a look at our OpenAccess C# Linq Examples application which shows more than 100 Linq sample queries. They should be enough for you to understand the power of Linq and OpenAccess when used together.
Hope that helps.