• 0

[VB.NET] DataAdapter.Fill = SLOOOOOOW


Question

Hello gang,

We're translating a VB6 app into .NET 2005 using Oracle's ODP.NET provider. The issue is we have a stored proc that returns multiple resultsets/recordsets/cursors/(whatever you want to call em) In Toad or other SQL tools the query comes RIGHT back... however in the .NET code the .FILL method is slow.

cmGet = New OracleCommand

dsGet = New DataSet

daGet = New OracleDataAdapter(cmGet)

daGet.Fill(dsGet) '10 seconds here!!

I have spent the last hour+ reading a ton of posts on newsgroups and not a single one gave an answer (or I've gone blind... oh no, Ive gone blind!!!)

Any thoughts?

Link to comment
https://www.neowin.net/forum/topic/546504-vbnet-dataadapterfill-sloooooow/
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Let's get the easy problems out of the way first. Are you testing this on a single machine or on the actual server? Most SQL tools will be much faster than the actual development environment testing as well, so it's not fair to compare them. Testing in a similar environment to the actual production environment will give you a better feel for how slow it really will be.

Is the SQL a problem? Specifically, does it contain a lot of joins or search for a lot of string?

Here's an example to try as well:

ds = null;
ds = new DataSet();
DataTable dt = new DataTable();
da.Fill(dt);
ds.Tables.add(dt)

Now, with that example as a foundation, you COULD fill a DataTable with a DataAdapter, then add it to the DataSet. See if that has any type of performance benefit.

There is also some SQL queries I've seen that involve Date Ranges that cause the Fill to become very slow. If you have date ranges in your Stored Proc that use SQL Parameters. If you do use Parameters, there are tons of problems that were solved if you search Google for them.

  • 0

Yes we are testing this against a server, in fact 3 different servers. One on site (windows based) and two off site (CoLo) one of these is our production db.

The SQL Query is rather plain (Im at home now and dont have the exact sql) In Toad or SQL*Plus the results from this proc come RIGHT back. So we know it's not the connection or execution. We have found that one of the queries in this proc (there are 11) is pulling back 26000 rows. This particual query is taking 7 seconds of the .FILL (damn!)

And yes, really the app should not be pulling back all 26 THOUSAND rows (I just got here, we bought the software and now me and my team-mates have to fix/improve it.

I'll try you code snipet in the morning, so thank you VERY much for your time.

We're also gonna try another ADO.NET provider (http://www.datadirect.com/products/net/net_for_oracle/index.ssp) and see if this works any better. Our other option is to use the DataReader and only use the DataTable when nessasary. (Decent sized application, so there is a lot for us to work out)

Peace,

James

  LRoling said:
Let's get the easy problems out of the way first. Are you testing this on a single machine or on the actual server? Most SQL tools will be much faster than the actual development environment testing as well, so it's not fair to compare them. Testing in a similar environment to the actual production environment will give you a better feel for how slow it really will be.

Is the SQL a problem? Specifically, does it contain a lot of joins or search for a lot of string?

Here's an example to try as well:

ds = null;
ds = new DataSet();
DataTable dt = new DataTable();
da.Fill(dt);
ds.Tables.add(dt)

Now, with that example as a foundation, you COULD fill a DataTable with a DataAdapter, then add it to the DataSet. See if that has any type of performance benefit.

There is also some SQL queries I've seen that involve Date Ranges that cause the Fill to become very slow. If you have date ranges in your Stored Proc that use SQL Parameters. If you do use Parameters, there are tons of problems that were solved if you search Google for them.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Just checked my B650 Motherboard again, nothing there as yet, Guess 800 series getting it first, which i can understand as that's newer series, and chipset. I'll check again in a few days or a week depending on how busy i am
    • Display Driver Uninstaller (DDU) 18.1.1.5 by Razvan Serea Display Driver Uninstaller (DDU) is a utility for completely removing AMD/NVIDIA/INTEL graphics drivers and related packages from your system, attempting to eliminate all leftovers (including registry entries, folders and files, driver store). Though AMD/NVIDIA/INTEL drivers can usually be removed via the Windows Control Panel, this uninstaller tool was created for situations where standard uninstall fails, or when you need to fully remove NVIDIA or ATI graphics card drivers. After using this driver cleaner, your system will behave as though it’s the first time you’re installing a new driver—similar to a fresh Windows installation. As with all such tools, we recommend creating a restore point beforehand, allowing you to undo changes if issues arise. If you're having trouble installing an older or newer driver, try it—there are reports that it resolves such problems. Recommended usage: The tool can be used in Normal mode but for absolute stability when using DDU, Safemode is always the best. Make a backup or a system restore (but it should normally be pretty safe). It is best to exclude the DDU folder completely from any security software to avoid issues. You do NOT need to uninstall the driver prior using DDU. Requirements: .NET Framework 4.8 Compatible with Windows 7, 8, 8.1, 10, and 11 (32-bit or 64-bit) Note: Using on Insider Preview builds is at your own risk. Display Driver Uninstaller (DDU) 18.1.1.5 changelog: Intel: Added NPU presence detection before removing shared DLL files (these were previously left to prevent potential NPU-related issues). Intel: Added optional NPU removal Improved "Extension" driver removal process. Updated several translations. Download: Display Driver Uninstaller 18.1.1.5 | 1.7 MB (Freeware) Download: DDU Portable | 1.2 MB Links: Display Driver Uninstaller Home Page | Screenshot | Forum Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • I just ordered a new MSI X870 board, hasn't even arrived yet. I checked the downloads page, and it has the firmware released on 6/11/2025 including the updated AGESA code.
    • There used to be an independent video game store in West Edmonton Mall around 20 years ago, I'm not sure when it went out of business, but they were selling console & PC games for $70±, I think it was so they could cover their rent!
  • Recent Achievements

    • Explorer
      Legend20 went up a rank
      Explorer
    • One Month Later
      jezzzy earned a badge
      One Month Later
    • First Post
      CSpera earned a badge
      First Post
    • One Month Later
      MIR JOHNNY BLAZE earned a badge
      One Month Later
    • Apprentice
      Wireless wookie went up a rank
      Apprentice
  • Popular Contributors

    1. 1
      +primortal
      625
    2. 2
      ATLien_0
      275
    3. 3
      +FloatingFatMan
      178
    4. 4
      Michael Scrip
      152
    5. 5
      Steven P.
      115
  • Tell a friend

    Love Neowin? Tell a friend!