views:

176

answers:

0

Using ActiveRecord in asp.net is it possible to select columns from two or more tables together to show information in grid as a single record? For example if I have two models (1) product model contains ID, ProductName, Price properties and (2) order model contains OrderID, ProductID, Quantity. I need to retrieve data(load) from both model together as FLAT.

Sample query:

select o.OrderID, p.ProductName, o.Quantity,
       p.Price, o.Quantity*p.Price as Total
from Product p, Order o
where p.ID = ProductID

How it can be done using ActiveRecord?