G
Guest
How do you get the actual value of a timestamp from a SQL Server 2000 database table using VB.Net? I want to use it in the Where clause, but the value returned is "System.Byte[]". Here is 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() As Byte = New Byte() {0, 1, 2, 3, 4, 5, 6, 7
'Assume my data is in a dataset
With ds.Tables(0).Rows(0
mintEmpID = .Item("EmpID"
mstrFN = .Item("FirstName"
mstrLN = .Item("LastName"
mbytTS = .Item("TS"
'Assume user changes data, and saves
'An 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
'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() As Byte = New Byte() {0, 1, 2, 3, 4, 5, 6, 7
'Assume my data is in a dataset
With ds.Tables(0).Rows(0
mintEmpID = .Item("EmpID"
mstrFN = .Item("FirstName"
mstrLN = .Item("LastName"
mbytTS = .Item("TS"
'Assume user changes data, and saves
'An 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