I am converting VB Code to C#. Following is the Code.
CrByMonthCr = Val(DateDiff("m", StartDate, DateSerial(Year(EndDate), Month(EndDate), 1)) + 1) * MonthCr
In C# code I imported namespace - using Microsoft.VisualBasic
.
I only managed to settle DateDiff
function. Val
& DateSerial
are giving compiler error.
CrByMonthCr = Val(DateAndTime.DateDiff("m", StartDate, DateSerial(Year(EndDate), Month(EndDate), 1)) + 1) * MonthCr
Does any one know why inspite of importing namespace of VisualBasic it is giving errors? How to solve this?
DateSerial does not exists in the current context