List all days of a month ASP.NET C# -


i want generate pivot table days of month image below.

enter image description here

is there way make list of days dynamically in sql or c#? month , year binded dropdownm, filled manually.

   <asp:label id="llbmes" runat="server" text="mês"></asp:label>   </td>     <td> <%--months--%>     <asp:dropdownlist id="ddmes" runat="server" height="18px" width="90px">    <asp:listitem text="janeiro" value="1"></asp:listitem>     <asp:listitem text="fevereiro" value="2"></asp:listitem>    <asp:listitem text="março" value="3"></asp:listitem>     <asp:listitem text="abril" value="4"></asp:listitem>     <asp:listitem text="maio" value="5"></asp:listitem>    <asp:listitem text="junho" value="6"></asp:listitem>    <asp:listitem text="julho" value="7"></asp:listitem>    <asp:listitem text="agosto" value="8"></asp:listitem>    <asp:listitem text="setembro" value="9"></asp:listitem>    <asp:listitem text="outubro" value="10"></asp:listitem>    <asp:listitem text="novembro" value="11"></asp:listitem>    <asp:listitem text="dezembro" value="12"></asp:listitem>     </asp:dropdownlist>&nbsp;&nbsp;     </td>     <td>       <asp:label id="llbano" runat="server" text="ano"></asp:label>     </td>     <td><%-- years--%>         <asp:dropdownlist id="ddano" runat="server" height="18px" width="90px">          <asp:listitem value="2015">2015</asp:listitem>         <asp:listitem value="2014">2014</asp:listitem>         <asp:listitem value="2013">2013</asp:listitem>         <asp:listitem value="2012">2012</asp:listitem>         <asp:listitem value="2011">2011</asp:listitem>         <asp:listitem value="2010">2010</asp:listitem>         <asp:listitem value="2009">2009</asp:listitem>         <asp:listitem value="2008">2008</asp:listitem>         <asp:listitem value="2007">2007</asp:listitem>         <asp:listitem value="2006">2006</asp:listitem>         <asp:listitem value="2005">2005</asp:listitem>         <asp:listitem value="2004">2004</asp:listitem>         <asp:listitem value="2003">2003</asp:listitem>         <asp:listitem value="2002">2002</asp:listitem>         <asp:listitem value="2001">2001</asp:listitem>     </asp:dropdownlist> 

 list<datetime> daysofmonth = enumerable.range(1, datetime.daysinmonth(year, month))  // days: 1, 2 ... 31 etc.                              .select(day => new datetime(year, month, day)) // map each day date                              .tolist();  

above returns days of specific month in specific year


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -