i am very new in c#.below is one of my function which return the Academic Year of given date.
i do it in vb.net and it is working fine.i need to do it in c# becuase now my current project is in c#.when i try it to convert it in c# and run it not working.
the Month function is not found in c#. like other Method also.
please some one hemp me to solved it.
Function in vb.net
Function FnYear(ByVal VDATE As Date) As String
If Month(VDATE) <= 0 Then
ScriptManager.RegisterStartupScript(Me, GetType(Page), UniqueID, "alert('Enter Valid Month.....!')", True)
FnYear = ""
If Month(VDATE) > 5 Then
FnYear = Right(Year(VDATE), 2) & "-" & Right(Year(VDATE) + 1, 2)
ElseIf Month(VDATE) <= 5 Then
FnYear = Right(Year(VDATE) - 1, 2) & "-" & Right(Year(VDATE), 2)
i use it like