Re: HELP! compare two SQL timestamps in C# byte arrays
From: Chris Barber (chris_at_blue-canoe.co.uk.NOSPAM)
Date: 09/19/04
- Next message: AndrwChau: "I am getting anerror when update the database"
- Previous message: Alex Homer: "Re: How can I view DataSet content in Command Window?"
- In reply to: Next: "Re: HELP! compare two SQL timestamps in C# byte arrays"
- Next in thread: Next: "Re: HELP! compare two SQL timestamps in C# byte arrays - My Solution"
- Reply: Next: "Re: HELP! compare two SQL timestamps in C# byte arrays - My Solution"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 19 Sep 2004 23:13:14 +0100
The inherent 'timestamp' for a record isn't based on time and as such to compare as being larger /
smaller than a specific date value for the purposes of saying:
Select all records that have changed after a specific time
Is meaningless and cannot be achieved. You would have to use your own methods to implement a
specific field in the table that stores a datetime value.
I have seen the same issue querying a remote Sybase database with a 'timestamp' field - the values
are not date oriented and as such you can only detect if a record has changed by referring back to a
cached 'timestamp' value and detecting equality. Luckily in my case the database table also had a
datetime field 'lastchanged' that I could use.
Chris.
"Next" <aeverett99NOSPAM@hotmailNOJUNK.com> wrote in message
news:eqSUHgonEHA.4056@TK2MSFTNGP09.phx.gbl...
Thank you for your reply Hermit,
I have tride ToBase64String().
The problem is I am not testing for Equality. I don't want to know if they
aren't equal.
I want to know which one is larger. You can test only for equality using
strings.
Any ideas? Anyone :)
Aaron
"Hermit Dave" <hermitd.REMOVE@CAPS.AND.DOTS.hotmail.com> wrote in message
news:uxJfeXnnEHA.1248@TK2MSFTNGP09.phx.gbl...
> timestamp equivalent in c# is byte[] as you already know.
> what you could do is use convert it to base64string and compare the
string.
> use Convert.ToBase64String() to do the byte[] ==> base 64 string
> and then normal string ==
>
> --
>
> Regards,
>
> Hermit Dave
> (http://hdave.blogspot.com)
> "Next" <aeverett99NOSPAM@hotmailNOJUNK.com> wrote in message
> news:OE34dLnnEHA.2576@TK2MSFTNGP10.phx.gbl...
> > Please don't over think my question here ;) This is not for
concurrency.
> >
> > Once I get a couple of SQL timestamps into respective C# byte arrays,
> > how do convert\manipulate the arrays to something I can compare.
> >
> > I want to know which timestamp is greater and store it:
> >
> > //this is what I am trying to do:
> > if ( _ts2 > _ts1)
> > _ts1 = _ts2;
> >
> > I have been searching for litterally 3 days for an answer. I have tried
> > every conversion I could think of, but no success.
> >
> > If someone out there knows how to compare two SQL timestamp contained in
> C#
> > byte arrays and is willing to share their knowledge, I would be forever
in
> > your debt.
> >
> > Thanks in advance for any help you would give,
> > Aaron
> >
> >
>
>
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.766 / Virus Database: 513 - Release Date: 17/09/2004
- Next message: AndrwChau: "I am getting anerror when update the database"
- Previous message: Alex Homer: "Re: How can I view DataSet content in Command Window?"
- In reply to: Next: "Re: HELP! compare two SQL timestamps in C# byte arrays"
- Next in thread: Next: "Re: HELP! compare two SQL timestamps in C# byte arrays - My Solution"
- Reply: Next: "Re: HELP! compare two SQL timestamps in C# byte arrays - My Solution"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|