timestamp

  • Thread starter Thread starter Jonas Knaus
  • Start date Start date
J

Jonas Knaus

hi there

in my database i have a column timestamp. now i read this entry with a
reader:

....
....
byte test ;
while (reader.Read())
{
test = Convert.ToByte(reader["AdrTimestamp"]);
}
....
....

i got the answer that this cast is not valid
i also tried to do id with a string

stringTest = Convert.ToByte(reader["AdrTimestamp"]);

or i tried:

stringTest = reader["AdrTimestamp"].ToString();

but the Value i then get is: "System.Byte[]" but i would like to see its
value....

could anyone help please ? this would be great...

thanks
jonas
 
According to documentation, Timestamp (for SQL Server) is an array of byte
[8 bytes].
..NET provides SQLBinary structure to play with.
I guess you could cast it to this type.

José
 
Back
Top