Reputation: 1644
Actually i want to add name of months(Using C sharp) along with value in drop down list and i want to add it pro-grammatically.I have get the method to display the name but for a particular month how to get the maximum number of days in it?
Upvotes: 1
Views: 997
Reputation: 1
Exec SpYearResult 2016 go Alter Procedure SpYearResult (@Year Int) as Begin Declare @Date dateTime; Declare @intValue int; declare @Test Table (Mon Varchar(50),DaysInMonth int) ; Set @intValue = 0 While @intValue <12 Begin SET @Date = Convert(Datetime,Convert(Varchar(4),@Year)+'-01-01') SET @date = DATEADD(mm,@intValue, @Date); INSERT INTO @Test SELECT DateName(mm,@date)+'-' +Convert(Varchar(4),@Year) as Mon, DAY(EOMONTH(@date)) AS DaysInMonth set @intValue = @intValue +1 End select * from @Test End
Upvotes: -1