Re: Sqlcommand object gives command timeout

From: M. Zeeshan Mustafa (zeeshan_at_no-spm.please.zeeshan.net)
Date: 06/22/04


Date: Tue, 22 Jun 2004 13:36:22 +0500

Hi Yaseen,

Try increasing Max Pool property of connection pooling, for
reference see this link:
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemDataSqlClientSqlConnectionClassConnectionStringTopic.asp

If you are using a data reader, its very important to close datareader
and connection after you're done, if you dont, connection will
go orphan!

-- 
Hope this helps,
Zeeshan Mustafa, MCSD
"Yaseen D M" <YaseenDM@discussions.microsoft.com> wrote in message
news:852E6F2B-DE48-4CAC-BB20-41496AEB04C1@microsoft.com...
> Hi,
>
> Yes i am closing the connections. and in table i have 102 records but it
brings 100 records from that table.
>
> Thank u
> Yaseen
>
> "Miha Markic [MVP C#]" wrote:
>
> > Hi Yaseen,
> >
> > This error normally occurs when you are not closing connections.
> > Do you?
> >
> > -- 
> > Miha Markic [MVP C#] - RightHand .NET consulting & development
> > miha at rthand com
> > www.rthand.com
> >
> > "Yaseen D M" <Yaseen D M@discussions.microsoft.com> wrote in message
> > news:3B55599F-192B-4E98-B41B-99967C8B39FC@microsoft.com...
> > > Hi,
> > >
> > > I am using sqlcommand object to execute a stored procedure. And i
populate
> > a dataset fro sqldataadapter. When i run it for the first time it works
fine
> > when try to go to the next page it gives the following error
> > >
> > > Error Message :Timeout expired.  The timeout period elapsed prior to
> > obtaining a connection from the pool.  This may have occurred because
all
> > pooled connections were in use and max pool size was reached.
> > >
> > > i tried giving commandtimeout=0 and also increased the timeout period
but
> > still it doesnot work
> > >
> > > Give me a solution..
> > >
> > > Regards
> > > Yaseen
> >
> >
> >


Relevant Pages

  • Re: Max pool size reached exception when trying to open a new connection
    ... Private Function GoodDataReaderCode(ByVal dataReader As IDataReader) ... 'The underlying connection to the database remains open and ... prior to obtaining a connection from the pool. ...
    (microsoft.public.dotnet.framework)
  • Re: Close and Dispose argument
    ... > fact that even Microsoft is not clear on the issue. ... > connections from the pool is still a debate. ... > method removes the conneciton from the connection pool". ... > Your issue was forwarded to us here at Microsoft Courseware Support. ...
    (microsoft.public.dotnet.framework.adonet)
  • Close and Dispose argument
    ... here is an email conversation between me and Microsoft ... connections from the pool is still a debate. ... Programming with Microsoft ADO.NET" module 2, p 18: "Calling the Dispose ... method removes the conneciton from the connection pool". ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: MinPoolSize behaviour
    ... Min Pool Size, The first time you open a connection we will open the 1 ... > Is the pool created forever? ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Q:Multithreaded ADO.Net Connections Are Non Pooled?
    ... different you get a new pool. ... > the process/app domain differences, does running on a thread created by ... If you're using SSPI, each connection must be ... >> connect to the SQL Server machine, ...
    (microsoft.public.dotnet.framework.adonet)