Dim day As String = Format(Today, "dddd") 'string format of days
Dim hoursinterval As Integer 'date borrowed
Dim retrievtime As Date 'date borrowed
Dim convertedtimeH As Integer 'hour borrowed
Dim convertedtimeM As Integer 'minute borrowed
Dim time As Date 'current date
Dim CurrHour As Integer ' current hour
Dim CurrMinute As Integer 'current minute
Public Sub timeOfOvernight(ByVal id As Integer, ByVal day As Integer)
If day >= 1 Then
sql = "UPDATE `tblborrow` SET `Due` = 1,`Remarks`='Over Due' WHERE Status='Borrowed' AND `Purpose` ='Overnight' and `BorrowID` in ('" & id & "')"
updates(sql)
Return
End If
End Sub
here is my updates code:
Function updates(ByVal sql As String)
Try
con.Open()
cmd = New MySqlCommand
With cmd
.Connection = con
.CommandText = sql
result = cmd.ExecuteNonQuery
' If result = 0 Then
'MsgBox("No updated data", MsgBoxStyle.Information)
'Else
'MsgBox("Data in the database has been updated")
'End If
End With
con.Close()
Catch ex As Exception
MsgBox(ex.Message & "update")
End Try
Return result
End Function
the problem in here is that when my book reaches it's due date it doesn't update the query in my database.. i adjust the date in my laptop but still it doesnt update. i don't get any error in this . that's why im having a hard time how will database update .
can some rebuild my code? im a newbie in vb.net and im still studying thank you so much