I want to create a task reminder (which the user add it to the database with a start date spot) every two weeks from the date already entered in the database. Based on the position of the day in the week, I made a try but to no avail, if someone has an idea I would be grateful
cmd5.CommandText = "select * from task where frequence='2W' "
da5.SelectCommand = cmd1
da5.Fill(ds5, "0")
DataGridView6.Columns.Add("fr", "fr")
DataGridView6.Columns.Add("class", "class")
For i As Integer = 0 To ds5.Tables(0).Rows.Count - 1
If Date.Now.DayOfWeek > 3 Then
If CType(ds5.Tables(0).Rows(i).Item(3), Date).DayOfWeek = Date.Now.DayOfWeek Or CType(ds5.Tables(0).Rows(i).Item(3), Date).DayOfWeek - ???? = Date.Now.DayOfWeek Then
DataGridView6.Rows.Add(ds5.Tables(0).Rows(i).Item(4), CType(ds5.Tables(0).Rows(i).Item(3), Date).DayOfWeek)
End If
End If
If Date.Now.DayOfWeek < 4 And Date.Now.DayOfWeek <> 0 Then
If CType(ds5.Tables(0).Rows(i).Item(3), Date).DayOfWeek = Date.Now.DayOfWeek Or CType(ds5.Tables(0).Rows(i).Item(3), Date).DayOfWeek + ???? = Date.Now.DayOfWeek Then
DataGridView6.Rows.Add(ds5.Tables(0).Rows(i).Item(4), CType(ds5.Tables(0).Rows(i).Item(3), Date).DayOfWeek)
End If
End If
Next
in "??????" I don't know what i can put to obtain the correct results !! can someone help me please !