C# timestamp datatype?

S

Soulless

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!
 
M

Marc Gravell

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

Marc
 
M

Marc Gravell

(and if you find that ugly, just run it through
Convert.ToBase64String / FromBase64String at your data-layer and work
with a string in your code)
 
M

Marc Gravell

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
 

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