Skip to content
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

Scaffolding is converting to the wrong data type #58

Closed
ChrisJollyAU opened this issue Aug 25, 2020 · 3 comments
Closed

Scaffolding is converting to the wrong data type #58

ChrisJollyAU opened this issue Aug 25, 2020 · 3 comments
Assignees

Comments

@ChrisJollyAU
Copy link
Member

Using 3.1-preview branch and OleDb

My database has been scaffolding successfully however in the classes for the tables have the wrong data types. Fields that should be a datetime (and is shown as a Date/Time in Access) are actually scaffolded as a decimal. Other fields that are an integer are scaffolded as a boolean.

It looks like you matching against the wrong values in ConvertToJetDataType

For reference the following links list the ADO Data Types
https://www.w3schools.com/asp/ado_datatypes.asp
https://docs.microsoft.com/en-us/sql/ado/reference/ado-api/datatypeenum?view=sql-server-ver15

To use 2 of them as an example
A Date/Time field is adDate (value 7) - The value 7 with DbType is a decimal
An integer field is adInteger (value 3) - The value 3 with DbType is a boolean

The rest are also as different as the examples. Do note that I'm using it with OleDb, not sure if the values would be different if using Odbc

@lauxjpn
Copy link
Member

lauxjpn commented Aug 25, 2020

See #55 (comment)
Please try again once the PR has been merged.

@ChrisJollyAU
Copy link
Member Author

Thanks. Will keep an eye out for the PR. I will note that I believe I have fixed/found a solution for the problems based on the current code

@ChrisJollyAU
Copy link
Member Author

The updated bits scaffold the datatypes correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants