Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
LINQ To SQL:Skip operator
WhatsApp
Vijai Anand Ramalingam
14y
3.7
k
0
0
25
Blog
EmpDetails Table:
Code:
To skip over a given number of elements in a sequence.
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
namespace
LINQ
{
class
Program
{
static
void
Main(
string
[] args)
{
DataClassesDataContext
dc =
new
DataClassesDataContext
();
IQueryable
<
EmpDetail
> empQuery = (
from
emp
in
dc.EmpDetails
orderby
emp.ID
select
emp).Skip(2);
foreach
(
EmpDetail
empDetail
in
empQuery)
{
Console
.WriteLine(
"ID :{0}, Name :{1}, Location :{2}, Department :{3}"
, empDetail.ID, empDetail.Name, empDetail.Location, empDetail.Dept);
}
Console
.ReadLine();
}
}
}
Output:
People also reading
Membership not found