Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Implementing Simple SQL Group by Functionality with LINQ Technology on a DataSet

, 26 Jul 2008
A simple SQL group by functionality is implemented with LINQ
GroupbyLINQ.zip
GroupbyLINQ
App_Code
App_Data
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_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 runat="server">
    <title>Sample Application By Using LINQ</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table>
    
    <tr>
    <td>
      <table>
      <tr>
      <th colspan ="4"  align="center" 
              style="text-shadow: Red; font-family: Verdana; font-size: large; text-decoration: underline;" >
      Sample Application By using the LINQ
         
        
      </th>
      </tr>
      <tr><td colspan="4"></td></tr>
      <tr><td colspan="4"></td></tr>
      
      <tr>
      <td colspan="4">
      
       <asp:Label ID="lblCaption" runat="server" Font-Bold="False" Font-Names="Times New Roman" 
              Font-Underline="False"></asp:Label>
      </td>
      </tr>
      <tr><td colspan="4"></td></tr>
      <tr><td colspan="4"></td></tr>
      <tr>
      <td colspan="2">
       <asp:GridView ID="DtGrid" runat="server" CellPadding="4" ForeColor="#333333" 
            GridLines="None" AllowPaging="false" 
               
              >
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
      
      </td>
      
      <td>
      <table>
      <tr><td></td></tr>
      <tr>
      <td>
            <asp:Button ID="btnGroupby" runat="server" Text="Group By" 
                onclick="btnGroupby_Click" 
                ToolTip="Sales Details Grouped by the Customer ID"   />
      </td>
      
      </tr>
      <tr><td></td></tr>
       <tr>
      <td>
              <asp:Button ID="btnGroupbyhaving" runat="server" Text="Groupby BY Having" 
                  onclick="btnGroupbyhaving_Click" 
                  ToolTip="Customer Details, who has more than 4 orders" />
      
      </td>
      </tr>
      <tr><td></td></tr>
      <tr>
      
      <td>
              <asp:Button ID="btnOrderby" runat="server" Text="Order BY" 
                  onclick="btnOrderby_Click" ToolTip="Sales Detais Order by Bill Date" />
      
      </td>
      </tr>
    <td></td>
       <tr>
      
      <td>
              <asp:Button ID="btnPurchaseDet" runat="server" Text="Purchase Details By Customer" 
                  onclick="btnPurchaseDet_Click" 
                  ToolTip="Total Amount of Purchases done by the customer" />
      
      </td>
      </tr>
     
      
      
      </table>
      
      </td>
      
      </tr>
      
      
      </table>
    
    </td>
   
    <td>
    <table>
    <tr>
    
    <td>
    
        <asp:Label ID="lblSQL" runat="server" Text="" ForeColor="#3366CC"></asp:Label>
    </td>
    
    </tr>
    <tr><td></td></tr>
    
    <tr>
    
    <td>
    <asp:Label ID="lblLINQ" runat="server" Text="" ForeColor="#009933"></asp:Label>
    
    </td>
    </tr>
    </table>
    
    </td>
    </tr>
    </table>
        
        
    
    </div>
    </form>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Sunil Yenugudati
Software Developer (Senior) London , U.K.
United Kingdom United Kingdom
No Biography provided

| Advertise | Privacy | Mobile
Web03 | 2.8.140814.1 | Last Updated 26 Jul 2008
Article Copyright 2008 by Sunil Yenugudati
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid