0
私人小组Button2_Click(BYVAL发件人为System.Object的,BYVALË作为System.EventArgs)把手Button2.Click如何更新在vb.net MySQL数据库
Dim remarks As String
Dim am_OUT As String = "11:30:01 AM"
If LblTime.Text >= am_OUT Then
remarks = "OVERTIME"
Else
remarks = "PRESENT"
End If
sql = "UPDATE attendance SET [email protected]_out, [email protected]_remarks " & _
"WHERE id_no= '" & Txtid.Text & "'AND date LIKE '" & LblDate.Text & "'and am_out is null"
Try
With com
.Connection = con
.CommandText = "SELECT * FROM attendance WHERE id_no LIKE '" & Txtid.Text & "' AND date LIKE '" & LblDate.Text & "'AND am_out is NOT NULL"
End With
com.Parameters.Add(New MySqlParameter("@am_out", LblTime.Text))
com.Parameters.Add(New MySqlParameter("@noon_remarks", remarks))
com.ExecuteNonQuery()
If remarks = "OVERTIME" Then
MessageBox.Show("You have little overtime")
ElseIf remarks = "PRESENT" Then
MessageBox.Show("You Log out on time")
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
末级
我不能更新我的数据库表中的mysql 和mysql数据库已经有了amin并且是备注
您是否收到异常错误消息? – Steve
我没有得到任何错误消息, –
在我的数据库中am_in已经有一个值00:00:00 –