That pesky timestamp thing

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?
 
E

Earl

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.
 
G

Guest

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
 
J

Jay Pondy

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top