<tr class="trData"> <td style="text-align: center;"> Select Month </td> <td style="text-align: left;"> <asp:DropDownList ID="ddlMonth" runat="server"> <asp:ListItem Text="Jan" Value="1"></asp:ListItem> <asp:ListItem Text="Feb" Value="2"></asp:ListItem> <asp:ListItem Text="Mar" Value="3"></asp:ListItem> <asp:ListItem Text="Apr" Value="4"></asp:ListItem> <asp:ListItem Text="May" Value="5"></asp:ListItem> <asp:ListItem Text="June" Value="6"></asp:ListItem> <asp:ListItem Text="July" Value="7"></asp:ListItem> <asp:ListItem Text="Aug" Value="8"></asp:ListItem> <asp:ListItem Text="Sep" Value="9"></asp:ListItem> <asp:ListItem Text="Oct" Value="10"></asp:ListItem> <asp:ListItem Text="Nov" Value="11"></asp:ListItem> <asp:ListItem Text="Dec" Value="12"></asp:ListItem> </asp:DropDownList> </td> </tr> <asp:GridView ID="gvOverallReport" runat="server" AutoGenerateColumns="true"> <pagerstyle cssclass="gridPagerStyle" horizontalalign="Center" width="100%" /> <SelectedRowStyle CssClass="gridSelectedRowStyle" /> <HeaderStyle CssClass="gridHeader" BackColor="#AFB8BF" HorizontalAlign="Left" VerticalAlign="Middle" BorderColor="#bbbbbb" BorderWidth="1px" Font-Bold="True" ForeColor="White" Font-Size="10pt" /> <alternatingrowstyle backcolor="WhiteSmoke" /> <pagersettings position="TopAndBottom" /> <rowstyle cssclass="grdRow" />
//dt is data table from store procedure and sDate is date field var qry=from row in dt.AsEnumerable() where row.Field<datetime>("sDate").Day== selectedDayFromDropDown select row gridview1.DataSource=qry.CopyToDataTable(); </datetime>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)