Navi
04-20-2008, 12:02 PM
Hi expert! How to get the code like this in VB.net? After the data is submitted to the Time1 field of the database, if the there is data in Time1, when the user click the button, it will shows erros "The data is submitted already!".
Here is my code and any help will be greatly appreciated!
Sub Do_test(sender as Object, e as EventArgs)
Dim CountTime as Int32 = 0
strSQL="Select count(*) from C WHERE IDEmployee= '" & currEmpNumber & "' and serverDate = '" & currServerDate & "'"
Call OpenDB()
Dim myCommand3 As New odbcCommand(strSQL, connTemp)
CountTime = myCommand3.ExecuteScalar()
Call CloseDB()
If CountTime = 0 Then
labelMessage.text = "* Error! You did not Enter the data! "
else
If CountTime > 0 Then
strSQL="UPDATE C SET Out1 = '" & currServerTime & "' WHERE IDEmployee= '" & currEmpNumber & "'
Call OpenDB()
call InsertUpdate(strSQL)
Call CloseDB()
// Anyway to add some coding here to test if the data (out1) does exist and if it does, promp an error message
End IF
end if
end if
Here is my code and any help will be greatly appreciated!
Sub Do_test(sender as Object, e as EventArgs)
Dim CountTime as Int32 = 0
strSQL="Select count(*) from C WHERE IDEmployee= '" & currEmpNumber & "' and serverDate = '" & currServerDate & "'"
Call OpenDB()
Dim myCommand3 As New odbcCommand(strSQL, connTemp)
CountTime = myCommand3.ExecuteScalar()
Call CloseDB()
If CountTime = 0 Then
labelMessage.text = "* Error! You did not Enter the data! "
else
If CountTime > 0 Then
strSQL="UPDATE C SET Out1 = '" & currServerTime & "' WHERE IDEmployee= '" & currEmpNumber & "'
Call OpenDB()
call InsertUpdate(strSQL)
Call CloseDB()
// Anyway to add some coding here to test if the data (out1) does exist and if it does, promp an error message
End IF
end if
end if