Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. OleDB or Sql?

OleDB or Sql?

Scheduled Pinned Locked Moved Database
databasecsharpsql-serveroraclecom
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alexandru Savescu
    wrote on last edited by
    #1

    I am the datalayer of an enterprise application with .NET. The database is now on SQL Server but we might port it for other systems like Oracle. To make it more portable we are using OleDB. I would like to know how much the performance would imporve should I use Sql classes when dealing with SQL server. Thanks. Best regards, Alexandru Savescu P.S. Interested in art? Visit this!

    B 1 Reply Last reply
    0
    • A Alexandru Savescu

      I am the datalayer of an enterprise application with .NET. The database is now on SQL Server but we might port it for other systems like Oracle. To make it more portable we are using OleDB. I would like to know how much the performance would imporve should I use Sql classes when dealing with SQL server. Thanks. Best regards, Alexandru Savescu P.S. Interested in art? Visit this!

      B Offline
      B Offline
      Brad Sokol
      wrote on last edited by
      #2

      Everything I've read says the same thing, but I've never seen it quantified. A solution that gives you some flexibility might be to use the ADO.NET interfaces rather than the concrete classes. Use a factory class to create your connections, data readers, data adapters, etc. and then in your data layer use the interface types, rather than the concrete types to work with the objects. To change to one of the other 'families' of classes, you only need to change the factory. You can have a factory for SQL Server and one for Oracle (with .NET 1.1). You could even instantiate the factory dynamically at runtime though you'll need a common base class or interface for your factories. Here is some psuedo-code: class SQLServerDataObjectFactory : DataObjectFactory {     public IDbConnection CreateConnection(...)     {         return new SqlConnection(...);     } } class OracleDataObjectFactory : DataObjectFactory {     public IDbConnection CreateConnection(...)     {         // The class name may be wrong - I don't have the .NET 1.1 framework installed         return new OracleConnection(...);     } } class MyDataLayerObject {     public void MyDataLayerMethod()     {         // Do stuff         // The data object factory was instantiated somewhere in the         // program's initialisation code.         IDbConnection connection = myDataObjectFactory.CreateConnection(...);         // Do stuff with connection. At this point, I don't care what         // concrete type it is.     } } Brad

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups