Well, I googled using timestamp and sql server and while there was some good advice out there, I never saw an example of how to send that value back to sql and compare it. All the examples showed how to pull it from the database and talked about the necessity of it when wanting to make sure there was no accidental overwrites, etc.
I am here to change that. It seems that the sql server timestamp type can be easily converted into a bigint and vice versa. This simplified a lot of items for me and made the timestamps very human readable.
Any how here is the code snippets:
SQL Server Get Code:
SELECT CAST(a.RowTimestamp AS BIGINT) AS RowTimestamp, ...
SQL Server Update Code:
WHERE RowTimestamp = CAST(@RowTimestamp AS TIMESTAMP)
Private _RowTimestamp as Int64 .... Public Property RowTimestamp() As Int64 Get Return _RowTimestamp End Get Set(ByVal value As Int64) _RowTimestamp = value End Set End Property
.NET Data Access Read
myClass.RowTimestamp = sqlDR.GetInt64(i)
I hope this helps you as it did me.
No Slogans, Just Results