That pesky timestamp thing

  • Thread starter Thread starter Earl
  • Start date Start date
E

Earl

Creating a datatable from scratch and then I'm inserting with a select in
the sproc to return the current values after the insert. Now I realize the
timestamp column is a datatype of byte, and I'm not trying to insert the
timestamp, but I want to keep the column in the datatable to be populated
with the return values. However, when the dataadapter tries to apply the
update, I'm getting an exception on the datatable timestamp datatype. Any
thoughts?
 
Well, the RDBMS is SQL2k, but the issue is on the .Net side -- there is no
actual datatype for timestamp, it is apparently a byte array. I don't see
how I could set that with GetType.
 
Earl,

This information may not be what you need, but:

When I read a timestamp value using a datareader I store the value in a byte
array dimemsioned like this:

Private UpdateStamp As Byte()

When I update a row in a table using a timestamp parameter in a Where
clause, I define the parameter as OleDbType.Binary like this:

cmdStudents.Parameters.Add("@UpdateStamp",
OleDb.OleDbType.Binary).Value = Me.UpdateStamp

Kerry Moorman
 
Back in the ASP days I used to convert timestamps to and from SQL int
types so that I could round-trip them from an ASP page. This might be
an option for you - makes dealing with them a whole lot simpler.
 
Back
Top