Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6889207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:07:37+00:00 2026-05-27T06:07:37+00:00

I have been tasked with a project at work of writing a class to

  • 0

I have been tasked with a project at work of writing a class to connect to multiple different databases such as Oracle, SQL Server, Spatialite etc and get and set data values and I was wondering which of the two in the title you would recommend for this.

I have created a class that utilises OLE functionality in order to make connections and set and retrieve data as I thought ADO was more of an SQL Server specific technology. Is this the case or can ADO.NET be used for a variety of data sources? I have researched it quite a lot and most places that I have seen recommend OLE for multiple possible data sources whereas they recommend ADO for SQL Server.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:07:38+00:00Added an answer on May 27, 2026 at 6:07 am

    I can’t see how OLE is going to provide a magic bullet for unifying the DAL. You want to use the data access framework that best suits the data source and abstract the implementation away from the application.

    My guess is that you’re hoping that using OLE will allow some unification of syntax. But this is not the case. Once you attempt to do something like paging, each data source is going to have its own quirks and how you connect to the source is not going to help unify the syntax differences. For example, in the case of paging, SQLite usings SKIP, TAKE. Oracle uses ROWNUM. Sql Server uses TOP.

    I would approach the problem by creating a DAL that abstracts the entity classes away from the data source. Then you can use the connection type that is most suitable for the data source. For example, suppose my application wants to retrieve “Products” from a data source. My application would only know about the ProductFactory interface, not the specifics of the data source type. For example,

    string id = "0000001";
    IProductFactory factory = FactoryManager.GetProductFactory();
    Product p = factory.Get(id);
    

    In the example below, I implement the Oracle data access tier for the Product interfaces using ODP.Net (the best data access components for an Oracle data source). Then the data access tier looks like this:

    DAL

    IProductFactory:

    public interface IProductFactory: IEntityFactory
    {
        Product Get(string productId);
        IList<Product> GetAll();
        int GetAllCount();
    }
    

    Product:

    public class Product : IEntity<Product>
    {
        public string ProductId { get; set; }
        public string Name { get; set; }
        public string Description { get; set; }
    
        #region IEntity<Product> Members
    
        public Product MapData(System.Data.IDataReader reader)
        {
            return new Product
            {
                Name = reader["name"] as string,
                Description = reader["description"] as string
            };
        }
    
        #endregion
    }
    

    Oracle ProductFactory

    public class ProductFactory : EntityFactory, IProductFactory
    {
        #region IProductFactory Members
    
        public Product Get(string productId)
        {
            Product p = null;
            using (OracleConnection conn = new OracleConnection(ConnectionString))
            {
                using (OracleCommand cmd = new OracleCommand())
                {
                    cmd.CommandText = "select * from product where productId = :productId";
                    cmd.Parameters.Add("productId", productId);
                    using (IDataReader reader = cmd.ExecuteReader())
                    {
                        p = new Product();
                        p.MapData(reader);
                    }
                }
            }
            return p;
        }
    
        public IList<Product> GetAll()
        {
            throw new NotImplementedException();
        }
    
    
        public int GetAllCount()
        {
            throw new NotImplementedException();
        }
    
        #endregion
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been tasked to optimize some sql queries at work. Everything I have
I have been tasked with a project which will entail multiple apps, a master
I have been tasked with building a new web project from scratch, with the
I've an ASP.NET MVC 3 project and have been tasked with implementing a few
I have been tasked with writing an ADP application using Access. The back-end data
I have been tasked with a project where I am to add a new
I have been tasked with refactoring a project that currently uses an EAV model
So I have this Access Database Project file that I have been tasked to
I have been tasked with updating a old project that I did not write.
At work I have been tasked with adding additional functionality to an existing MVC

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.