Language Integrated Query (LINQ) Question: Download Questions PDF
Write a Program using Skip and Take operators. How can it beneficial for bulky data accessing on page?
Answer:
“skip” and “take” Operator used for Paging. Suppose we have Customer table of 100 records. To find 10 records by skipping the first 50 records from customer table-
Public void Pagingdatasource ()
{
Var Query = from CusDetails in db.customer skip (50) Take (10)
ObjectDumper.Write(q)
}
Hence The LinQ “ SKIP” operator lets you skip the results you want, and “Take” Operator enables you yo select the rest of result . So By Using Skip and Take Operator, You can create paging of Specific sequence.
Public void Pagingdatasource ()
{
Var Query = from CusDetails in db.customer skip (50) Take (10)
ObjectDumper.Write(q)
}
Hence The LinQ “ SKIP” operator lets you skip the results you want, and “Take” Operator enables you yo select the rest of result . So By Using Skip and Take Operator, You can create paging of Specific sequence.
Download LINQ Interview Questions And Answers
PDF
Previous Question | Next Question |
What is Linq to SQL Deferred Loading? | Write a Program for Concat to create one sequence of Data Rows that contains DataTabless Data Rows, one after the other? |