0

i've got error when using "skip" in linq

there is my query:

Dim list = 
(From u In db.User
    Group Join l In db.Lookup.Where(Function(l) l.Type = "UserStatus") On u.Status Equals l.Code Into Group
    From l In Group.DefaultIfEmpty()
    Select New UserDto With {
            .Id = u.Id,
            .Username = u.Username,
            .Status = u.Status,
            .StatusValue = l.Value,
            .CountWrongTries = u.CountWrongTries,
            .LastLogin = u.LastLogin,
            .CreatedTime = u.CreatedTime,
            .CreatedBy = u.CreatedBy,
            .UpdatedTime = u.UpdatedTime,
            .UpdatedBy = u.UpdatedBy}).Where(Function(u) u.Username.Contains("a")).
OrderBy(Function(n) n.Username).Skip(1).Take(5).ToList()

there is error outout

An exception has been raised that is likely due to a transient failure
inner exception: 

A transport-level error has occurred when sending the request to the server. (provider: Named Pipes Provider, error: 0 - The specified network name is no longer available.)

but its runing well if i remove "skip(1)" syntax

i need "skip" for pagination big record

( sorry my bad english)

Rahul Singh
  • 21,585
  • 6
  • 41
  • 56
  • http://stackoverflow.com/questions/2962927/a-transport-level-error-has-occurred-when-receiving-results-from-the-server – Rahul Singh Nov 06 '15 at 07:30
  • Wouldn't it make more sense to have the `Where` and `Order By` inside the query instead of outside as separate function calls? I'm not sure whether it would make a difference to your issue but I'd do that first. – jmcilhinney Nov 06 '15 at 08:42
  • i restart my computer then run the program again but this time i'v got the result. maybe something error inside my computer.. Thx all – prabhaswara Nov 09 '15 at 02:02

0 Answers0