Hey. I am currently working with Oracle databases. I wanted to use EntityFramework on the client, but I encountered the following problem: when I try to retrieve data using the data model, I get an "type mismatch" error. In the table there is a field of type NUMBER; in the model, this field is created with the type Byte. This has its own logic, but the hitch is that negative values are also stored in this field in the database, and when I try to assign a negative value to a field with the type Byte, I get an error. I tried to manually change the field in the data model on the SByte or something, all in vain. An error like: "... oracle.number is not compatible with edm.SByte ...". Who can that prompts?
- On int or long try to replace, with these types oracle works without problems, at least for me. The NUMBER type corresponds to OracleDbType.Decimal and, oddly enough, without shamanism, it is cast to long and int, but not to Sysytem.Decimal. If it helps, then you can already think how to get what you need - rdorn
- @rdorn, tried - does not come out. In general, it turns out to be interesting: if you create a model based on EF 5.x, then the field with type NUMBER (2) is reduced to short, and when using EF 6.x, it is reduced to type byte. And when I try to work with EF 5.x, I can’t initialize the context class at all. - Fortune
|