tags:

views:

218

answers:

0

Hello I have a problem with Skip function.. I code I have for fetching data is

db_stamperDataContext context = new db_stamperDataContext();

        //var modifier = (from m in context.Modifiers
        //                where m.Modifier1 == "Public"
        //                select m).First();

        //var item = from p in context.Items
        //           where (p.UserID == user_id && user_id != -1) ||
        //                 p.ModifierID == 2
        //           orderby p.ID descending
        //           select p;

        var item = from p in context.Items
                   where p.UserID == user_id
                   orderby p.DateAdded descending
                   select p;

        return item;

The second part of the commented one is the one I wanted to use and the last one is the one which is working in my other code and wasn't working on the current implementation.

The Exception it gives me is : where the query is a single-table (non-join) query, or is a Distinct, Except, Intersect, or Union (not Concat) operation

I find it abit strange coz it works on my other code using the third part above (Uncommented one).

How do delete this question ....

Sorry guy, I think I have found my problem. There is a table in the designer haven't set a primary key for it so it gives me an error.