Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

PortalWebHosting
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Indoo
 


  Sponsors  

Meet Our Sponsors

Click here to go to dev.live.com for Windows Live developer resources
SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! (Pro...  DAL+ sql connection closing
Previous Previous
 
Next Next
New Post 5/4/2008 11:42 AM
User is offline Boki
20 posts
10th Ranked


DAL+ sql connection closing 

Hello,

I'm using next code for reading data from database:

Using myIDataReader As IDataReader = CType(DataProvider.Instance().ExecuteSQL("SELECT ItemsID FROM {databaseOwner}{objectQualifier}SomeItems WHERE ItemsCode = @ItemsCode AND FirmID = @FirmID", ItemsCodeParam, FirmIDParam), IDataReader)
            myIDataReader.Read()

            intItemsID = myIDataReader.GetInt32(0)
        End Using

 

and it all worked fine until this error:

Error   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 thought I closed sql connection with "using". Am I wrong? I chaged max pool size and it work little longer, until crash. After that I set "pooling=false", but that is not right solution.  I forgot to mention I'm using AJAX, if that is relevant for this problem...

 

Thanks

 
New Post 5/5/2008 9:12 AM
User is offline Chris Hammond
2556 posts
engagesoftware.com
5th Ranked








Re: DAL+ sql connection closing 

I'm not sure why Using would close the read, but myIDataReader.Close() should work for you.


Chris Hammond
Engage Software
St. Louis, MO
314.966.4000


The leading provider of DotNetNuke skinning, training and custom module development.
Official DotNetNuke® Training Provider
 
New Post 5/6/2008 3:49 AM
User is offline Boki
20 posts
10th Ranked


Re: DAL+ sql connection closing 

Hi,

 

thanks for reply...

 

Does myIDataReader.Close()  also close sql connection?

 
New Post 5/6/2008 7:43 AM
User is offline Chris Hammond
2556 posts
engagesoftware.com
5th Ranked








Re: DAL+ sql connection closing 

Yes I believe it does.

The problem with using the ExecuteSQL statement that you used is that that statement doesn't really know it's returning a datareader, so it won't close it automatically.


Chris Hammond
Engage Software
St. Louis, MO
314.966.4000


The leading provider of DotNetNuke skinning, training and custom module development.
Official DotNetNuke® Training Provider
 
New Post 5/6/2008 3:56 PM
User is offline Boki
20 posts
10th Ranked


Re: DAL+ sql connection closing 

What about ExecuteReader or ExecuteScalar?

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! (Pro...  DAL+ sql connection closing
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


ADefWebserver.com
DotNetNuke® Module Development Help Website
ADefWebserver.com
Get Smarter Mail, SmarterStats, SmarterTickets
Windows mail server, web log analytics, and customer service management software - Free Editions Available!
www.smartertools.com
Venexus, Inc.
Need custom a custom DotNetNuke module? From module planning to deployment, including training and support, Venexus developers deliver end-to-end web solutions on time and on budget.
www.venexus.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP