Problem with .Net syntax from VB6

Hi guys,

How do i do this in VB.NET

Code:
d = CDate("01/" & m & "/" & Y) + i - 1


It keeps saying 'Operator + is not defined for types 'Date' and 'Interger'

Thanks


Answer this question

Problem with .Net syntax from VB6

  • castanza

    Flex.Col = Weekday(.Fields("DateFrom")) - 1

    iRow = DatePart("ww", (rs!datefrom)) - DatePart("ww", DateSerial(Year(rs!datefrom), Month(rs!datefrom), 1)) + 1

    Ok, so what am i doing wrong here this works in VB6


  • JimJulson

    As far as I know the default property value is not working anymore. So you need to specify ".value" behind "rs!datefrom".
  • venkateswarlu

    DateTime has a method called AddDays:



    Dim s As String = "01/" & m & "/" & y
    Dim d As DateTime = DateTime.Parse(s).AddDays(i - 1)

     


  • Problem with .Net syntax from VB6