i have 3 tables (Categories, Articles and ArticleCategories). The ArticleCategories has a combined PK and concists of:
- ArticleID (PK, FK, int)
- CategoryID (PK, FK, int)
Now when I'm using the subsonic paging methods I'm running into some very strange behaviour. It returns double the amount of records then I expect (the 2 PK's?). The issue is resolved by either removing the paging completely or by adding a PK field called ArticleCategoryID.
SubSonic.Query qry = new SubSonic.Query(DAL.ArticleCategory.Schema);
qry.AddWhere(DAL.ArticleCategory.Columns.CategoryID, filterid);
//Pagesize
qry.PageSize = Classes.Settings.PageSizes.GetAdminPageSize();
//Pageindex
if (pageindex > 0)
qry.PageIndex = pageindex;
else
qry.PageIndex = 1;
The above code works for all other tables but it fails with a many-to-many relationship. I could resort to adding the extra (and single) PK field but that doesn't feel right.
Maybe I'm missing something obvious here so I apologize for that in advance :)
Thank you for your time Kind regards, Mark