Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to count total days in pertricular month using stored procedure.


i have one dropdown,which select month.i have to display number of days in that month in gridview.
Posted
Updated 11-Jul-14 18:05pm
v3
Comments
Sergey Alexandrovich Kryukov 19-Feb-13 1:13am    
What did you try so far?
—SA

Paste this code in DDL SelectedIndexChanged event

C#
int days = DateTime.DaysInMonth(2013, Convert.ToInt32(ddlMonth.SelectedValue));

For Sql Server
http://www.sqllion.com/2009/07/total-number-of-days-in-a-month/[^][]
 
Share this answer
 
v2
Always follow the tips: :-) Day DropDown[^]
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900