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  
Biz Modules provides professional business modules and solutions for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

Salaro -- Skins and more
OnyakTech
CrystalTech Web Hosting™
Webhost4life, specialists in DNN hosting
Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
AspDotNetStoreFront - E-Commerce by Design - The Leading ASP.NET shopping cart platform for developers!
 


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
Online now... 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
Online now... 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.

 


Disgrafic
Diseño y creación de portales web dinámicos :: Desarrollo de módulos personalizados :: Soluciones a medida :: Imagen Corporativa :: Tu proveedor DNN en España
www.disgrafic.com
DM Analytics, LLC
DM Analytics, LLC provides software solutions that facilitate rapid development of independent or dependent datamarts and their associated web-based reporting.
www.dmanalytics.com
Integral Hosting | DNN only $14.95/month
Experienced .NET hosting on Windows 2003, ASP.NET 1.1 & 2.0, MSSQL with real technical support.
www.integralhosting.com

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