0 Replies Latest reply: Jul 8, 2013 12:27 PM by phowe001 RSS

    Cannot get Entity Framework 5 and power tools to place nice with Oracle 11g(11.2.0.2)

    phowe001

      I am wrestling with one of those wonderful idiosyncrasices that crop up when you don't use 100% microsoft. Our company uses Oracle 11g, not SQL Server. After a long battle, I was finally able to connect to the Oracle database and generate the "code first reverse engineer" POCOs and such with the EF 5  Power Tools. There are hundreds of tables in the database and I saw no way to specify a subset of those, so it took hours to generate the code. Tools/components are VS2012 (C#), Oracle 11g, EF 5, "Power tools" for EF, Windows 7 Enterprise.

       

      I wrote some extremely simple code to see the auto-generated classes work:


      using System.Text;
      using Entities;
      using Entities.Models;

      namespace EntitiesConsoleTests
      {
          class Program
         
      {
              private static void Main
      (string[] args)
             
      {
                  Console
      .Write("Press <Enter> to begin...");
                  Console
      .ReadLine();
                  try
                 
      {
                     
      using (var db = new Context())
                     
      {
                          var q
      = from usr in db.USERS
                                  orderby usr
      .USERNAME
                                 
      select usr;
                          foreach
      (var u in q)
                         
      {
                              Console
      .WriteLine(u.USERNAME);
                         
      }
                     
      }
                 
      }
                  catch
      (Exception ex)
                 
      {
                      Console
      .WriteLine("Exception: " + ex.Message);

                 
      }
                  Console
      .Write("Press <Enter>");
                  Console
      .ReadLine();
             
      }
         
      }
      } 


       

      When I run this test code, I get the following dialog:  (Since I do not seem to be allowed to upload images, I will approximate it in text):

       

      I get a dialog entitled "EntitiesConsoleTests.exe - This application could not be started."

         ( X ) This application requires one of the following versions of the .NET Framework:   
       
      .NET Framework, Version=v4.5 

        Do you want
      to install this .NET Framework version now?  
       
      [ Yes ]   [ No ]

       

       

      Thanks in advance for any tips or help.

       

      Peter