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. General Programming
  3. LINQ
  4. Stored procedure versus LINQ

Stored procedure versus LINQ

Scheduled Pinned Locked Moved LINQ
databasecsharpasp-netlinqperformance
5 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.
  • C Offline
    C Offline
    compninja25
    wrote on last edited by
    #1

    I have a sql database which contains the core information I need to display for my users. I also have a couple of columns of information on an AS400 that I would like to perform a join on. I'm not too familiar with LINQ or stored procedures yet, and I would like to see what you guys would recommend using. There are quite a few records in these tables so performance is key. Thanks!

    "You're damned if you do, and you're damned if you dont" - Bart Simpson

    N 1 Reply Last reply
    0
    • C compninja25

      I have a sql database which contains the core information I need to display for my users. I also have a couple of columns of information on an AS400 that I would like to perform a join on. I'm not too familiar with LINQ or stored procedures yet, and I would like to see what you guys would recommend using. There are quite a few records in these tables so performance is key. Thanks!

      "You're damned if you do, and you're damned if you dont" - Bart Simpson

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      itmaster21 wrote:

      I'm not too familiar with LINQ or stored procedures yet

      I would suggest doing some research in that case. Stored procedures are database functions while Linq can be anything from Linq to Objects to Linq to SQL to Linq to Active Directory and many more flavors


      only two letters away from being an asset

      C 1 Reply Last reply
      0
      • N Not Active

        itmaster21 wrote:

        I'm not too familiar with LINQ or stored procedures yet

        I would suggest doing some research in that case. Stored procedures are database functions while Linq can be anything from Linq to Objects to Linq to SQL to Linq to Active Directory and many more flavors


        only two letters away from being an asset

        C Offline
        C Offline
        compninja25
        wrote on last edited by
        #3

        Hi Mark, Sorry, when I originally wrote the post I wasn't thinking as clearly as I should have been. I'm familiar enough with both functions to understand what they do, but not enough to be able to sit down and write the code without doing a good bit of research first. To that extent, I figured I should find out which one would be more efficient for my situation before spending a lot of time going down the wrong road. The better question would be considering I have two seperate databases, would it be wiser to write a stored procedure that connects to the DB2 and joins the tables onto the SQL and simply returns the results to the C# code, or better to access both the SQL and DB2 directly from the C# code and process using Linq after I get the full result sets? I'm leaning more toward the stored procedure because to me it seems more efficient to eliminate the un-needed results before ever passing it back to my program, but I'm not sure if that's the case or not. Thanks!

        Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

        N K 2 Replies Last reply
        0
        • C compninja25

          Hi Mark, Sorry, when I originally wrote the post I wasn't thinking as clearly as I should have been. I'm familiar enough with both functions to understand what they do, but not enough to be able to sit down and write the code without doing a good bit of research first. To that extent, I figured I should find out which one would be more efficient for my situation before spending a lot of time going down the wrong road. The better question would be considering I have two seperate databases, would it be wiser to write a stored procedure that connects to the DB2 and joins the tables onto the SQL and simply returns the results to the C# code, or better to access both the SQL and DB2 directly from the C# code and process using Linq after I get the full result sets? I'm leaning more toward the stored procedure because to me it seems more efficient to eliminate the un-needed results before ever passing it back to my program, but I'm not sure if that's the case or not. Thanks!

          Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          Of course either way would work. Its a question of which is better for scalability and maintainability as well as performance. The stored proc does filter the results before sending them out but a well designed data layer wouldn't send extra data to the next layer either.


          only two letters away from being an asset

          1 Reply Last reply
          0
          • C compninja25

            Hi Mark, Sorry, when I originally wrote the post I wasn't thinking as clearly as I should have been. I'm familiar enough with both functions to understand what they do, but not enough to be able to sit down and write the code without doing a good bit of research first. To that extent, I figured I should find out which one would be more efficient for my situation before spending a lot of time going down the wrong road. The better question would be considering I have two seperate databases, would it be wiser to write a stored procedure that connects to the DB2 and joins the tables onto the SQL and simply returns the results to the C# code, or better to access both the SQL and DB2 directly from the C# code and process using Linq after I get the full result sets? I'm leaning more toward the stored procedure because to me it seems more efficient to eliminate the un-needed results before ever passing it back to my program, but I'm not sure if that's the case or not. Thanks!

            Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

            K Offline
            K Offline
            Keith Barrow
            wrote on last edited by
            #5

            We've a AS400 system where I work. Finding the correct "flavour" of the AS400/DB2 dlls to support the entity framework from IBM was unecessarily complicated for us. Eventually we had to get ALL versions sent to us and one poor soul in our department had to pick through the documentation to find which version we needed. It took him a week. Full time. That said, now we have it, it seems to work fine. Have a look at the website, try and find the correct flavour for your rig & you'll see what I mean

            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