Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System.Data.ODBC problems

Status
Not open for further replies.

amateursRus

Technical User
Oct 10, 2005
15
0
0
GB
Hi,

I'm having a problem using the above (in C# 2005 Express) to return data from an Oracle 10 Db.
The code I'm using is -

using (OdbcConnection oraCon = new OdbcConnection(OraConnectString))
{
OdbcCommand OraCmd = new OdbcCommand(OraQueryString, oraCon);
oraCon.Open();

OdbcDataAdapter OraAdapter = new OdbcDataAdapter();
OraAdapter.SelectCommand = OraCmd;

DataTable oraTable = new DataTable();
OraAdapter.Fill(oraTable);
rowCount = oraTable.Rows.Count;
MessageBox.Show( "oraTable count = " + rowCount );
}

If I run a query to return a count or sum of fields it runs in a few seconds but if I try to return a row list from the single table I'm querying the process falls over with the mouse cursor stuck in receive.
The table is large(ish) with over 125,000 rows but I can't see the simple size being a problem?
My workstation has 2Gb of RAM so that should not be a problem.
Any ideas/help gratefully accepted.
 
check out this should provide much better support for orcale than an odbc connection.

125,000 isn't that much data. my guess is there is an indexing issue. with the database. if orcale has some form of query analyizer try profiling the raw query to determine if the db needs to be adjusted.

if this is the case, or you need assistance profiling the query try an oracle forum for more details.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Something else that might be interesting is to attach to the RowUpdated event on the DataAdapter. This could give you a feel for how long it takes for each row to be retrieved from the database, if some records are taking longer than others, or if it's an initial connection issue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top