Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 937043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:24:39+00:00 2026-05-15T21:24:39+00:00

I have a bit of .NET code that retrieves the results from an Oracle

  • 0

I have a bit of .NET code that retrieves the results from an Oracle Stored Procedure, using the ADO.NET Library, and populates the results into a DataTable like so:

using System.Data.OracleClient;

public DataTable getData()
{
    OracleConnection conn = new OracleConnection("Data Source=DATASOURCE;Persist Security Info=True;User ID=userID;Password=userPass;Unicode=True;Min Pool Size=1;Max Pool Size=20;Connection Lifetime=300");
    DataTable dt = new DataTable();
    conn.Open();
    try
    {
       OracleCommand oraCmd = new OracleCommand();
       oraCmd.Connection = conn;
       oraCmd.CommandText = "stored_procedure.function_name";
       oraCmd.CommandType = CommandType.StoredProcedure;
       oraCmd.Parameters.Add("cursor", OracleType.Cursor).Direction = ParameterDirection.Output;
       OracleDataAdapter oraAdapter = new OracleDataAdapter(oraCmd);
       oraAdapter.Fill(dt);
    }
    finally
    {
       conn.Close();
       return dt;
    }
}

This code has been working without any issues on several projects I have implemented the code on. However I am running into an issue on a new project, where the Oracle DB machine is actually much slower to respond, and seems to become unresponsive when too many clients begin to access the hardware. What I would like to do is implement some sort of timeout on the oraAdapter.Fill command – as it appears that when the database becomes unresponsive, the .NET application will hang on the ‘Fill’ method for as long as 10 minutes or more, never reaching the ‘finally’ codeblock and closing the DB connection.

I am in an environment where I am restricted to using the MSDN Library for connecting to the Oracle Database, so I’m hoping I can do it using the ADO.NET Control.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:24:40+00:00Added an answer on May 15, 2026 at 9:24 pm

    The CommandTimeout property does not work using the System.Data.OracleClient .NET 3.5 Provider. It appears that this functionality is not supported without the use of an external library.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this bit of code that is being converted from vb6 to vb.net.
I have the following code setup: http://jsfiddle.net/bABHU/2/ Had to change it a little bit
I have a 32-bit .net application that uses a native 32-bit DLL via DllImport().
I have an existing 32-bit ASP.NET application that used 32-bit unmanaged DLLs. If I
I have a .NET assembly that needs to be 32-Bit and needs to be
I have a pretty simple ASP.NET Web Form that looks a bit like the
I have an executable that defaults to 32-bit. It doesn't have source code and
I´m a bit confused here. The thing is that I have an asp.net textbox
I have a bit of code where you can add a new field using
I have some .NET code I use from VB6 code. I have always developed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.