ExecuteDataSet()需要很长时间,因此会出现超时错误 [英] ExecuteDataSet() is taking long time and hence time out error

查看:640
本文介绍了ExecuteDataSet()需要很长时间,因此会出现超时错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在使用ExecuteDataSet()从Oracle数据库中获取数据。
当我直接运行qury时
在数据库上,我在20秒内获取记录。

但是当我使用ExecuteDataSet()在c#中执行查询时,需要很长时间并给出超时错误。



请分享您的想法。



这就是我调用方法的方式。



ds = dataBase.ExecuteDataSet(dbCommand);

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);

推荐答案





试试给dbcommand超时。



Hi,

Try to give timeout to dbcommand.

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





我怀疑如果您的查询在db中成功运行20秒,请检查您的代码,可能会有一些问题。



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.


这篇关于ExecuteDataSet()需要很长时间,因此会出现超时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆