Today, in this article let's play around with one of the interesting and most useful concepts in LINQ.
Question: What is take operator?
In simple terms "It provides flexibility to pull out the requested amount of records with help of take operator in LINQ.".
Step 1: Create a new "ASP.NET Web Application", as in:

Step 2: The design of the Employee table looks like this:


Step 3: The complete code of WebForm1.aspx looks like this:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="LINQInnerJoinApp._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<center>
<div>
<table>
<tr>
<td colspan="2">
<asp:Label ID="Label1" runat="server" Text="Take Operator using LINQ" Font-Bold="true"
Font-Size="Large" Font-Names="Verdana" ForeColor="Maroon"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:Button ID="Button1" runat="server" Text="Select Data" Font-Names="Verdana" Width="213px"
BackColor="Orange" Font-Bold="True" OnClick="Button1_Click" />
</td>
</tr>
<tr>
<td colspan="2" align="center">
<br />



Comments
Join the conversation! Your thoughts help the community grow.