Use of DataTimeOffset means you must use SqlDataReader
See original GitHub issueDapper returns an IDataReader
on it’s extension method on top of the SqlConnection
. Unfortunately, this does not contain the GetDateTimeOffset
member that SqlDataReader
does, so the generated SqlHydra code does not work.
Is there an alternative for the use of this member that would work with an IDataReader
?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
c# - Reading a date using DataReader
Try as given below: while (MyReader.Read()) { TextBox1.Text = Convert.ToDateTime(MyReader["DateField"]).ToString("dd/MM/yyyy"); }.
Read more >SqlDataReader Class (System.Data.SqlClient)
Provides a way of reading a forward-only stream of rows from a SQL Server database. This class cannot be inherited.
Read more >SqlDataReader.GetSqlDateTime does not support ...
Describe the bug It seems like DATETIME2 sql server datatype is not fully or correctly implemented in SqlDataReader. using method ...
Read more >UTC gotchas in .NET and SQL Server - Derek says:
Any datetime values retrieved through the SqlDataReader will be an “unspecified” kind DateTime. This means that, even if you're correctly using ...
Read more >How to read DateTimeOffset from OracleObject
We have reproduced the issue when the object field of the Oracle type TIMESTAMP(6) WITH TIME ZONE returns as System.DateTime. We will ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Interesting… Apparently the Dapper crew wrapped it in an extra layer, so I had to do this:
Perfect, thanks.