timestamp

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jonas Knaus

    #1

    timestamp

    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["AdrTimesta mp"]);
    }
    ....
    ....

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

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

    or i tried:

    stringTest = reader["AdrTimesta mp"].ToString();

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

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

    thanks
    jonas


  • José Joye

    #2
    Re: timestamp

    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é

    "Jonas Knaus" <nospam_jonas_k naus@hotmail.co m> a écrit dans le message de
    news:OtC3Yv1hDH A.2452@TK2MSFTN GP10.phx.gbl...[color=blue]
    > 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["AdrTimesta mp"]);
    > }
    > ...
    > ...
    >
    > i got the answer that this cast is not valid
    > i also tried to do id with a string
    >
    > stringTest = Convert.ToByte( reader["AdrTimesta mp"]);
    >
    > or i tried:
    >
    > stringTest = reader["AdrTimesta mp"].ToString();
    >
    > but the Value i then get is: "System.Byt e[]" but i would like to see its
    > value....
    >
    > could anyone help please ? this would be great...
    >
    > thanks
    > jonas
    >
    >[/color]


    Comment

    Working...