G
Guest
I am using a class to store values from a query, but I have found no documentation to show how to capture the actual value of a timestamp from a SQL Server 2000 database table using VB.Net. I need to use the timestamp in the Where clause of an update statement, but the value returned is "System.Byte[]", not the actual value. Here is some of my code
'Assume I've pulled these fields from table (TS is timestamp
Select EmpID, FirstName, LastName, TS From Employee
Private mintEmpID As Intege
Private mstrFN As Strin
Private mstrLN As Strin
'I'm using a byte array to store the TS. Is that the right way to do it
Private mbytTS(8) As Byt
'Here's my data
With ds.Tables(0).Rows(0
mintEmpID = .Item("EmpID"
mstrFN = .Item("FirstName"
mstrLN = .Item("LastName"
mbytTS = .Item("TS"
End Wit
When the user changes the data and saves, the update query using the TS in the Where clause fails because mbytTS reads 'System.Byte[]' instead of the actual timestamp
Private sql as Strin
sql = "Update Employees Set FirstName='" & mstrFN & "', LastName='" & mstrLN & "' Where EmpID = " & mintEmpID & " And TS =" & mybtT
I'm missing the key thing here, which is the actual timestamp value. Can someone please tell me how to capture the timestamp into a variable, and reference it correctly in the update query? Thank you in advance for your help
'Assume I've pulled these fields from table (TS is timestamp
Select EmpID, FirstName, LastName, TS From Employee
Private mintEmpID As Intege
Private mstrFN As Strin
Private mstrLN As Strin
'I'm using a byte array to store the TS. Is that the right way to do it
Private mbytTS(8) As Byt
'Here's my data
With ds.Tables(0).Rows(0
mintEmpID = .Item("EmpID"
mstrFN = .Item("FirstName"
mstrLN = .Item("LastName"
mbytTS = .Item("TS"
End Wit
When the user changes the data and saves, the update query using the TS in the Where clause fails because mbytTS reads 'System.Byte[]' instead of the actual timestamp
Private sql as Strin
sql = "Update Employees Set FirstName='" & mstrFN & "', LastName='" & mstrLN & "' Where EmpID = " & mintEmpID & " And TS =" & mybtT
I'm missing the key thing here, which is the actual timestamp value. Can someone please tell me how to capture the timestamp into a variable, and reference it correctly in the update query? Thank you in advance for your help