Cor Ligthert [MVP]
6/11/2008 4:00:00 PM
Roy,
Why should that affect the AdoNet parameter, be aware that a DateTime
structure in Net is as well a long in ticks starting at 0001 and ending at
9999 (this is not actual true), however for those living then it is probably
no problem.
Therefore it should in my idea even match more.
Cor
"Roy" <Roy@discussions.microsoft.com> schreef in bericht
news:EBD990F6-E25C-4F41-A467-267892537A4D@microsoft.com...
>I am talking about datetime2 in SQL Server 2008. It is supposed to be in
> ticks. How do I convert the DateTime into query string which is in ticks?
>
> "Cor Ligthert[MVP]" wrote:
>
>> Roy,
>>
>> Be aware that a datetime column in SQL server before 2005 is very much
>> less
>> precise then in Net.
>>
>> By instance is the startdate the date that in the Britisch Empire as last
>> country in the western atmosfeer the Gregorian calendar was using instead
>> as
>> the Julian one. (And therefore as well for the British colonies in
>> America,
>> in the Spanish and French colonies that was about 200 years earlier).
>>
>> Cor
>>
>> "Roy" <Roy@discussions.microsoft.com> schreef in bericht
>> news:428C9B6A-0144-4146-AEE1-CE460264A801@microsoft.com...
>> > I am using a query for a SqlDataAdaptor to populate the DataSet a
>> > table. I
>> > use SqlCommandBuilder to create Insert/Update/Delete query. Can
>> > parameterized
>> > query be used in such a case such as WHERE MyColumn = @MyParameter?
>> >
>> > For a datatime2 column, what is the format for query?
>> > string.Format("WHERE MyDatetimeColumn = '{0}'",
>> > myDatetime.ToString("yyyy-MM-ddTHH:mm:ss.fff")) only gives to the
>> > millisecond. How to be as accurate as ticks?
>> >
>> >
>> >
>> >
>>