New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding DateTime2 parameter #188
Comments
Seems like something that PP should allow to be configured |
I just bumped into this problem now. Recommended type for MSSQL date is datetime2, while PetaPoco is mapping everything to datetime. If I create POCO class with .NET DateTime property, exception is thrown when trying to Insert, because of SQL datetime overflow even though it is defined as datetime2 in database. |
One possible solution is adding function to interface IProvider |
Sorry guys, It's been so long and I've actually forgot about it totally. therefore I'm sure I won't be of much help. |
No worries mate. I should have some free time starting mid-year. Tickets, list this one, are on my list ;) |
I just have the same problem. Is a fix like AnsiString workaround (varchar/nvarchar) possible? |
AnsiString and DateTime2 fix my table model [Column("NAME", IsAnsi = true)] |
@roggmaeh Can you please open a pull request so we can review and comment? |
Please see my comments in the PR. I'm not sure that this work is needed. |
Adding full DateTime with milliseconds in petepoco
AddParam
will be treated asDateTime
which will loss the milliseconds part, and if I amend the if else case withwill treat all
DateTime
parameters asDateTime2
which ok in my case as I'm usingDateTime2
everywhere but it'll invalid the where clause forDateTime
parameter if it's againstDateTime
only column.I wonder if it possible to determine the column type for the parameter ?
The text was updated successfully, but these errors were encountered: