By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,694 Members | 1,846 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,694 IT Pros & Developers. It's quick & easy.

Data reader

P: n/a
Ram
I am using ADO.Net data reader to retrieve data from main
frame. I am getting timestamp which is 26 (yyyy-mm-dd hh-
mm-ss.123456) bytes as sqltimestamp data type. I am using
data reader to retrieve this values and when i get it
from data reader it is coverting as (yyyy-mm-dd hh-mm-ss
AM or PM) and drops milliseconds.

If any one of you come across this problem pls let me
know how u have handled this situation.

Thanks in advance.
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
If you debug the read loop, can you see that the format has changed, or is
it when you assign the object to a dataTable or something ?

Regards - OHM#
Ram wrote:
I am using ADO.Net data reader to retrieve data from main
frame. I am getting timestamp which is 26 (yyyy-mm-dd hh-
mm-ss.123456) bytes as sqltimestamp data type. I am using
data reader to retrieve this values and when i get it
from data reader it is coverting as (yyyy-mm-dd hh-mm-ss
AM or PM) and drops milliseconds.

If any one of you come across this problem pls let me
know how u have handled this situation.

Thanks in advance.


Regards - OHM# On**********@BTInternet.com
Nov 20 '05 #2

P: n/a
I think your problem is that a timestamp in SQL is in fact NOT a date time
format. It is in fact just an eight byte value that changes when a row is
written to. (see SQL Books Online help for further information)
In .NET, you can deal with these values using a 64 bit integer type, either
Int64 or Unit64. Alternatively you can use a byte array. You may find it
easiest to use SqlBinary type.

"ra****@yahoo.com" <an*******@discussions.microsoft.com> wrote in message
news:09****************************@phx.gbl...
Yes the format has changed while reading from the reader
itself.
-----Original Message-----
If you debug the read loop, can you see that the format

has changed, or is
it when you assign the object to a dataTable or

something ?

Regards - OHM#
Ram wrote:
I am using ADO.Net data reader to retrieve data from main frame. I am getting timestamp which is 26 (yyyy-mm-dd hh- mm-ss.123456) bytes as sqltimestamp data type. I am using data reader to retrieve this values and when i get it
from data reader it is coverting as (yyyy-mm-dd hh-mm- ss AM or PM) and drops milliseconds.

If any one of you come across this problem pls let me
know how u have handled this situation.

Thanks in advance.


Regards - OHM# On**********@BTInternet.com
.

Nov 20 '05 #3

P: n/a
ram
It is a problem with Data reader and they are working on
for workaround. Thanks for yr reply.
-----Original Message-----
I think your problem is that a timestamp in SQL is in fact NOT a date timeformat. It is in fact just an eight byte value that changes when a row iswritten to. (see SQL Books Online help for further information)In .NET, you can deal with these values using a 64 bit integer type, eitherInt64 or Unit64. Alternatively you can use a byte array. You may find iteasiest to use SqlBinary type.

"ra****@yahoo.com" <an*******@discussions.microsoft.com> wrote in messagenews:09****************************@phx.gbl...
Yes the format has changed while reading from the reader itself.
>-----Original Message-----
>If you debug the read loop, can you see that the format
has changed, or is
>it when you assign the object to a dataTable or

something ?
>
>Regards - OHM#
>
>
>Ram wrote:
>> I am using ADO.Net data reader to retrieve data from

main
>> frame. I am getting timestamp which is 26 (yyyy-mm-
dd hh-
>> mm-ss.123456) bytes as sqltimestamp data type. I am

using
>> data reader to retrieve this values and when i get
it >> from data reader it is coverting as (yyyy-mm-dd hh- mm- ss
>> AM or PM) and drops milliseconds.
>>
>> If any one of you come across this problem pls let

me >> know how u have handled this situation.
>>
>> Thanks in advance.
>
>Regards - OHM# On**********@BTInternet.com
>
>
>.
>

.

Nov 20 '05 #4

P: n/a
When you have some news on this, could you post it back to the NG.

Thanks - OHM#

ram wrote:
It is a problem with Data reader and they are working on
for workaround. Thanks for yr reply.
-----Original Message-----
I think your problem is that a timestamp in SQL is in fact NOT a
date time format. It is in fact just an eight byte value that
changes when a row is written to. (see SQL Books Online help for
further information) In .NET, you can deal with these values using a
64 bit integer type, either Int64 or Unit64. Alternatively you can
use a byte array. You may find it easiest to use SqlBinary type.

"ra****@yahoo.com" <an*******@discussions.microsoft.com> wrote in
message news:09****************************@phx.gbl...
Yes the format has changed while reading from the reader
itself.
-----Original Message-----
If you debug the read loop, can you see that the format has
changed, or is it when you assign the object to a dataTable or
something ?

Regards - OHM#
Ram wrote:
> I am using ADO.Net data reader to retrieve data from main
> frame. I am getting timestamp which is 26 (yyyy-mm- dd hh-
> mm-ss.123456) bytes as sqltimestamp data type. I am using
> data reader to retrieve this values and when i get it
> from data reader it is coverting as (yyyy-mm-dd hh- mm- ss
> AM or PM) and drops milliseconds.
>
> If any one of you come across this problem pls let me
> know how u have handled this situation.
>
> Thanks in advance.

Regards - OHM# On**********@BTInternet.com
.

.


Regards - OHM# On**********@BTInternet.com
Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.