DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Tue, 21 Aug 2007 10:08:16 -0700,    posted on: microsoft.public.dotnet.framework.adonet        back       

Thread Index
  1    Manohar
          2    Braulio Diez


DataAdapter.Fill(Dataset) shows timeout error.   
I am executing a stored procedure and returning a resultset.  The
stored procedure takes approx 40 secs to execute.  I have set the
connection and command timeout to 10000, but I am still getting the
error, "Timeout expired.  The timeout period elapsed prior to
completion of the operation or the server is not responding."

Here is the code for executing the stored procedure.
private DataSet ExeCmdWithDataSet(string SQLText, string strdbconnect)
{
                SqlConnection cn = new SqlConnection();
                cn.ConnectionString = strdbconnect;
                cn.Open();

                DataSet ds = new DataSet();
                SqlCommand cmd = new SqlCommand();
                cmd.CommandTimeout = 10000;
                cmd.CommandType = CommandType.Text;
                cmd.CommandText = SQLText;
                cmd.Connection = cn;

                cmd.Prepare();

                SqlDataAdapter da = new SqlDataAdapter(SQLText, cn);
                da.Fill(ds);
                cn.Close();

                return ds;
}

Please help.

Thanks,
Date:Tue, 21 Aug 2007 10:08:16 -0700   Author:  

RE: DataAdapter.Fill(Dataset) shows timeout error.   
Mmm...

  I think it could be a good idea to check first if the problems is related 
with the DataSet or if it's the Stored procedure or if it's too much data.

  Could try to run the same query using a SqlDataReader and a loop and check 
if using that retrieves data ? (from there we can further research and check 
if it's because of the dataset or ...)

  HTH 
    Braulio

/// ------------------------------
/// Braulio Diez
///
/// http://www.tipsdotnet.com
/// ------------------------------




"Manohar" wrote:


> I am executing a stored procedure and returning a resultset.  The
> stored procedure takes approx 40 secs to execute.  I have set the
> connection and command timeout to 10000, but I am still getting the
> error, "Timeout expired.  The timeout period elapsed prior to
> completion of the operation or the server is not responding."
> 
> Here is the code for executing the stored procedure.
> private DataSet ExeCmdWithDataSet(string SQLText, string strdbconnect)
> {
>                 SqlConnection cn = new SqlConnection();
>                 cn.ConnectionString = strdbconnect;
>                 cn.Open();
> 
>                 DataSet ds = new DataSet();
>                 SqlCommand cmd = new SqlCommand();
>                 cmd.CommandTimeout = 10000;
>                 cmd.CommandType = CommandType.Text;
>                 cmd.CommandText = SQLText;
>                 cmd.Connection = cn;
> 
>                 cmd.Prepare();
> 
>                 SqlDataAdapter da = new SqlDataAdapter(SQLText, cn);
>                 da.Fill(ds);
>                 cn.Close();
> 
>                 return ds;
> }
> 
> Please help.
> 
> Thanks,
> 
> 
Date:Wed, 22 Aug 2007 01:04:05 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us