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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Optimezed use ADO.Net?

Optimezed use ADO.Net?

Scheduled Pinned Locked Moved Database
csharphelpquestion
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.
  • R Offline
    R Offline
    rbarzallo
    wrote on last edited by
    #1

    Hi, Which is better and than guarantees better rapidity and perfomance? ">>> SProcedure, SqlCommand, SqlReader, SqlDataAdapter <<<<" I have a transaccional system and I am using SqlDataAdapter with DataSet and the times of process are very high. If somebody can help me, thanks. Thanks,

    S 1 Reply Last reply
    0
    • R rbarzallo

      Hi, Which is better and than guarantees better rapidity and perfomance? ">>> SProcedure, SqlCommand, SqlReader, SqlDataAdapter <<<<" I have a transaccional system and I am using SqlDataAdapter with DataSet and the times of process are very high. If somebody can help me, thanks. Thanks,

      S Offline
      S Offline
      slvrscremr
      wrote on last edited by
      #2

      First and foremost, I suppose that "SProcedure" is short for "stored procedure", since I know no object in the .NET framework with that name. The other three have their different purposes. SqlReader: Lightweight, very fast. Read-Only, forward-read, server-side cursor. Good for populating lists or retrieving other data that you do not need to keep readily available for transactions. SqlCommand: Pretty much a necessity if you are going to issue a transaction to a database. The only question is whether you are going to do it in a stored procedure or a text string. If the RDBMS you are using supports stored procedures, I would unconditionally support that. Not only do you wrap your insert values in parameter objects ( prevents SQL injection hacks - another column entirely ), but the stored procedure is already pre-compiled and should execute faster than a SQL-text insert. SqlDataAdapter: Used to fill datasets / datatables with data resulting from a query. Very powerful, as you can use this object to populate relational data from your database and use the dataset object to maintain the information in memory. You just have to be very careful about how you construct your transaction logic, as it can become a major headache. Also, check the layout of your database's table structure. Make sure that each table has ( at least ) one index defined and that you are utilizing it as often as possible when retrieving and updating table information. Finally, check your querys and check any joins that you may have. Full table joins ( joins without indexes ) and < gasp > Cartesian joins can stall even the best server if the tables are large enough. Hope this helps, Darien :beer: "I don't know. I haven't tried today." - Trumpet icon Maynard Ferguson's response when asked how high he could play.

      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