none
Unable to find the requested .Net Framework Data Provider. It may not be installed.

    Question

  • I have Oracle database 11g installed properly and working. I have also installed the correct version of ODT that works with VS 2012 premium edition. I can access the database using EF5 without incident. However, when I created a WCF service library to access the same table using the exact same code, I got the error: "Unable to find the requested .Net Framework Data Provider.  It may not be installed."

    Please advise what was wrong with my logic.

    This is test console using EF to access oracle SUPERMARKET table.

    namespace SupermarketConsole
    {
        class Program
        {
            static void Main(string[] args)
            {
                using (var db=new SupermarketEntities())
                {
                    List<SupermarketClass> storelist = db.SUPERMARKETs
                                      .Select(x=>new SupermarketClass(){ StoreId=x.StoreId,ProductDescription=x.ProductCategory,ProductID=x.ProductId} )
                                      .ToList<SupermarketClass>();
                }
            }
        }
    }

    The supermarketclass is defined as follow:

    namespace SupermarketLib
    {
        public class SupermarketClass
        {
            public decimal StoreId { get; set; }
            public string ProductDescription { get; set; }
            public string ProductID { get; set; }
        }
    }
    

    The standalone program works perfectly.

    However, if I create another WCF Service Library ISupermarketService

    namespace SupermarketService
    {
        [ServiceContract]
        public interface ISupermarketService
        {
            [OperationContract]
            List<SupermarketData> GetSupermarket(int value);
    
        }
    
        [DataContract]
        public class SupermarketData
        {
            [DataMember]
            public decimal StoreId { get; set; }
            [DataMember]
            public string ProductDescription { get; set; }
            [DataMember]
            public string ProductID { get; set; }
        }
    }

    And its implementation is:

    namespace SupermarketService
    {
        public class SupermarketService : ISupermarketService
        {
    
            public List<SupermarketData> GetSupermarket(int value)
            {
                List<SupermarketData> storelist;
                using (var db = new SupermarketEntities())
                {
                    storelist = db.SUPERMARKETs
                                      .Select(x => new SupermarketData() 
                                      { 
                                          StoreId = x.StoreId, 
                                          ProductDescription = x.ProductCategory, 
                                          ProductID = x.ProductId 
                                      })
                                      .ToList<SupermarketData>();
                }
                return storelist;
            }
        }
    }

    When F5 was pressed to run the service, wcfTestClient was created but has iMetadataExchange error:

    When I click ok to ignore the error/warning, My service seems to be okay.

    But when I invoked getSupermarket service, I encountered the error above

    My Oracle Table Structure is:

    Name            Null Type        
    --------------- ---- ------------
    StoreId              NUMBER      
    ProductCategory      VARCHAR2(20)
    ProductId            VARCHAR2(20)

    Anyone has any idea what went wrong? If so, I would appreciate it if you could advise me.

    Thanks!

    Monday, December 08, 2014 8:24 PM