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. Web Development
  3. ASP.NET
  4. OleDBConnection or SQLConnection

OleDBConnection or SQLConnection

Scheduled Pinned Locked Moved ASP.NET
7 Posts 3 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.
  • M Offline
    M Offline
    meenakumar
    wrote on last edited by
    #1

    Hi, I would like to know that which type of object would give better performance in case I want to work with sql server. Should it be OleDBConnection or SQLConnection? Somewhere I read that SQLCOnnection can give better performance but I think at the sql server there is a SNAC (sql server native access client service) or a Net library which anyway consists of OLEDB and ODBC component. So instead if we use OLEDBConnection, wouldn't it be faster? The next query I have is not related to original question but I request to clear my confusion by letting me know which one is better option to free these objects? Should these be freed by Marshal.ReleaseComObject or just closing the connection and then making them NULL? thanks, kMeena

    D A 2 Replies Last reply
    0
    • M meenakumar

      Hi, I would like to know that which type of object would give better performance in case I want to work with sql server. Should it be OleDBConnection or SQLConnection? Somewhere I read that SQLCOnnection can give better performance but I think at the sql server there is a SNAC (sql server native access client service) or a Net library which anyway consists of OLEDB and ODBC component. So instead if we use OLEDBConnection, wouldn't it be faster? The next query I have is not related to original question but I request to clear my confusion by letting me know which one is better option to free these objects? Should these be freed by Marshal.ReleaseComObject or just closing the connection and then making them NULL? thanks, kMeena

      D Offline
      D Offline
      Dev S
      wrote on last edited by
      #2

      when u r using the sql server use sqlconnection. and add "System.Data.SqlClient" namespace.

      1 Reply Last reply
      0
      • M meenakumar

        Hi, I would like to know that which type of object would give better performance in case I want to work with sql server. Should it be OleDBConnection or SQLConnection? Somewhere I read that SQLCOnnection can give better performance but I think at the sql server there is a SNAC (sql server native access client service) or a Net library which anyway consists of OLEDB and ODBC component. So instead if we use OLEDBConnection, wouldn't it be faster? The next query I have is not related to original question but I request to clear my confusion by letting me know which one is better option to free these objects? Should these be freed by Marshal.ReleaseComObject or just closing the connection and then making them NULL? thanks, kMeena

        A Offline
        A Offline
        anilpal
        wrote on last edited by
        #3

        Hi, If u use sqlclient in that case it use oledb partially (some code of oledb) and rest it will communcate directly with native code , where as if u use oldedb in that case it use fully(complete code of oledb).

        Regards Anil Pal

        D 1 Reply Last reply
        0
        • A anilpal

          Hi, If u use sqlclient in that case it use oledb partially (some code of oledb) and rest it will communcate directly with native code , where as if u use oldedb in that case it use fully(complete code of oledb).

          Regards Anil Pal

          D Offline
          D Offline
          Dev S
          wrote on last edited by
          #4

          so according to you sqlclient should not be used there??

          A 1 Reply Last reply
          0
          • D Dev S

            so according to you sqlclient should not be used there??

            A Offline
            A Offline
            anilpal
            wrote on last edited by
            #5

            Hi, No its mean sqlclient is better bcz it use min code to communicate with DB where as oledb reuquired more

            Regards Anil Pal

            D 1 Reply Last reply
            0
            • A anilpal

              Hi, No its mean sqlclient is better bcz it use min code to communicate with DB where as oledb reuquired more

              Regards Anil Pal

              D Offline
              D Offline
              Dev S
              wrote on last edited by
              #6

              ya dats true, as after seeing ur reply i thought u r saying oledb is better.

              M 1 Reply Last reply
              0
              • D Dev S

                ya dats true, as after seeing ur reply i thought u r saying oledb is better.

                M Offline
                M Offline
                meenakumar
                wrote on last edited by
                #7

                but what if I want to make my application generic. In that case there is no alternative to OLEDB. SqlConnection can not work with oracle database.

                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