Try this:
Dim originDate As DateTime = DateTimePickerFixCosts1.Value
Dim result1 As DateTime = originDate.AddMonths(MonthssToAdd)
BTW:
1) Do not use ADODB within VB.NET. Use
ADO.NET[
^] instead!
2) Do not use concatenated text to build query. Use
parameterized queries[
^] instead, because your code is
Sql Injection[
^] vulnerable!
Finally:
Dim dt As DataTable = New DataTable()
Try
Using connection As New SqlConnection("ConnectionStringHere")
conection.Open()
Using command As New SqlCommand("commandTextHere", connection)
Using reader As SqlDataReader = command.ExecuteReader()
dt.Load(reader)
End Using
End Using
End Using
Catch Ex As Exception
Console.WriteLine(Ex.Message)
End Try
If dt.Rows.Count=0 Then
End If
Good luck!