C# timestamp datatype?

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

    #1

    C# timestamp datatype?

    Hi,

    I am accessing a stored proc from within C# and the result of the proc
    populate a dataset.

    The problem is, the proc returns an int and a timestamp. I do not
    need the timestamp and wish it was not there, but it is and my code
    fails because I am not sure what I can send the timestamp to in
    C# .... right now I have a column in my dataset defined as string, but
    it doesn't not work.

    Is there a datatype in C# I can use that will allow the return of a
    timestamp, or another suggestion on how I can get around this?

    Thanks!
  • Marc Gravell

    #2
    Re: C# timestamp datatype?

    byte[] - i.e. an array of bytes. For info "timestamp" is the same as
    varbinary(8), except for the automatic update behavior

    Marc

    Comment

    • Marc Gravell

      #3
      Re: C# timestamp datatype?

      (and if you find that ugly, just run it through
      Convert.ToBase6 4String / FromBase64Strin g at your data-layer and work
      with a string in your code)

      Comment

      • Marc Gravell

        #4
        Re: C# timestamp datatype?

        One other thought if you get this type of problem again... simply
        declare it as "object", then set a break-point and find what the
        system decided to use (and change you code to use that)... it isn't
        elegant (and it isn't fool-proof), but it will usually work.

        Marc

        Comment

        Working...