Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I am using ExecuteDataSet() to fetch the data from Oracle database.
when I run the qury directly on the databse i fetches records in 20 sec.
but when i execute the query in c# using ExecuteDataSet() it taking very long time and giving time out error.

Please share your ideas.

this is the way I am calling the method.

ds = dataBase.ExecuteDataSet(dbCommand);
Posted
Updated 7-Feb-18 23:52pm
v2

1 solution

Hi,

Try to give timeout to dbcommand.

C#
dbCommand.CommandTimeout = 500;//As per your query taking time


I have one doubt that if your query successfully run in 20sec in db, then pls check in your code, there may be some issue.
 
Share this answer
 
Comments
Sreepada1005 2-Aug-13 2:38am    
Thnks for your response.

my command time out is 0.which means unlimited.Even I tried giving 600.
dbCommand.CommandTimeout = 0;

1st three execution s are fine.problem encounters from 4th or 5th execution.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900