Oracle Beta EF Provider - Why Does It Not Let Me Display Decimal Number In Number Field

So ... I downloaded and installed the beta version of Oracle from my EF provider ... Why? Since nothing else works very well (I tried one on CodePlex, as well as the one that was on MSDN), and my company will not pay for commercially available (for example, from devart).

So he did a great job. I was able to see the oracle database, select the specific scheme in which I was interested, display table definitions. Fine!

Now I get the error message. Apparently, the default behavior of the provider is to match numbers (1,0) with boolean types in .NET. Not good, but, I should be able to change that, right? The error I received was something like "types do not match." Therefore, I change the definition of this field to decimal (1,0).

Now the new error I get is that decimal (1,0) is incompatible with the number (1,0). And I'm stuck. I can’t make changes to the display for everything that works.

I don’t like using Oracle to start, because they seem to have been supporting .NET for a couple of years. Now I am ready to completely abandon them.

So my question is ... Can I get Oracle to work with EF in some way besides the devart components? It will make my life easier if I can. If not, then I get the code with the full code of this kindness ... or I suggest the partner switch to the SQL server, since it is just as good (for what it works with it ...)

+3
source share
3 answers

This sounds like beta 1. By default, beta 1 matched the number (1,0) with the logical and all other numbers up to decimal.

2 . Beta 2 , Number (1,0), , int long, (X, 0). readme, , , , - - 2, . ( , 1 - , , , .)

-2, , -1. , .

+1

XML, 2 SSDL Decimal 2 CSDL .

+1

Oracle 11g ODAC beta vresion EF4. , , . Stored Prodedure , , RefCusrose, In Views, (1,0) Boolean .

, Oracle , , , , .

1. .Config

ODAC EF Beta 2 Number (1, 0) Edm.Int16. app.config web.config (1, 0) Edm.Boolean.

- 2:

Oracle NUMBER (p, 0) , app.config, web.config machine.config.

, NUMBER (1, 0) Int16. NUMBER (1, 0) .NET Bool .NET Byte. .

app.config, , NUMBER (1, 0) Bool, NUMBER (3,0) , Int16, Int32, Int64 4, 9, 18 5, 10, 19 :

 <?xml version="1.0" encoding="utf-8"?>
 <configuration>
 <connectionStrings>
 </connectionStrings>
 <oracle.dataaccess.client>
 <settings>
 <add name="bool" value="edmmapping number(1,0)" />
 <add name="byte" value="edmmapping number(3,0)" />
 <add name="int16" value="edmmapping number(4,0)" />
 <add name="int32" value="edmmapping number(9,0)" />
 <add name="int64" value="edmmapping number(18,0)" />
 </settings>
 </oracle.dataaccess.client>
 </configuration>

2. :

 namespace convert{
static class boolConvert
 {

  public static bool boolchar(char ON)
  {
    switch (ON)
    {
      case 'O':
      return true;
      case 'N':
      return false;
      default:
      return true;
    }
  }

  public static char charbool(bool ON)
  {
   switch (ON)
   {
    case true:
    return 'O';
    case false:
    return 'N';
    default:
    return 'O';
   }
  }

}
}

, :      bool isSomthing = convert.boolConvert.boolchar('N');      char isSomthigEelse = convert.boolConvert.charbool(true);

3. POCO

, POCOs, . "MyField", - :

 public bool MyField_Boolean
 {
 get
 {
  return MyField == 'O';
 }
 }

You cannot use MyField_Boolean inside an EF Linq query (because it is not a database property), but somewhere else in your code you can use it instead to get the logical version.

Although I have not tested any of them yet, but perhaps this will solve your problem. I hope that the next version of ODAC will not have these problems.

0
source

All Articles