This question is locked. New answers and comments are not allowed.
Hi,
I am trying to get all produscts that match a specific Category using the using Northwind database for a test.
In the ORM I have used only 3 tables for this test: Product, Category and Supplier.
I have checked in the reverse mapping the option 'Create one-to-many list' for the field product in the Category Table.
Now in my code I have the following for show all products list in a RadGrid for a specific category:
The result return an IndexOutOfRangeException !
What is wrong ?
Thanks for help.
Sam
I am trying to get all produscts that match a specific Category using the using Northwind database for a test.
In the ORM I have used only 3 tables for this test: Product, Category and Supplier.
I have checked in the reverse mapping the option 'Create one-to-many list' for the field product in the Category Table.
Now in my code I have the following for show all products list in a RadGrid for a specific category:
protected void Page_Load(object sender, EventArgs e) { |
var result = from cat in Scope.Extent<Category>() |
where cat.CategoryID == 1 |
select new { Products = cat.Products }; |
RadGrid1.DataSource = result; |
RadGrid1.DataBind(); |
} |
The result return an IndexOutOfRangeException !
What is wrong ?
Thanks for help.
Sam