System.Data.OleDb.OleDbException: System resource exceeded ERROR

G

Guest

I have a loop to create instances of my user control at run time, for example:
for intPageCounter=0 to intNumberOfPages
dim objUser as new MyUserCtrl
objUser.getProducts()
Panel1.Controls.Add(objUser)
next
The method "getProducts" connect to Acces 2003 DB every time and get DataReader containing required data.

After a while this error message appeared:
System.Data.OleDb.OleDbException: System resource exceeded.

Please advice.
 
M

Miha Markic [MVP C#]

Hi,

You are not closing DataReaders or/and Connection instances.

--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

A. Moghazy said:
I have a loop to create instances of my user control at run time, for example:
for intPageCounter=0 to intNumberOfPages
dim objUser as new MyUserCtrl
objUser.getProducts()
Panel1.Controls.Add(objUser)
next
The method "getProducts" connect to Acces 2003 DB every time and get
DataReader containing required data.
 
G

Guest

Hi
I did
objReader.close(
objReader = nothin
objConn.close(
objConn = nothin

The error still exist
Note: in Windows Task Manager the "PF Usage" reachess 700 MB every time when this error occured.

----- Miha Markic [MVP C#] wrote: ----

Hi

You are not closing DataReaders or/and Connection instances

--
Miha Markic [MVP C#] - RightHand .NET consulting & software developmen
miha at rthand co
www.rthand.co

A. Moghazy said:
I have a loop to create instances of my user control at run time, fo example
for intPageCounter=0 to intNumberOfPage
dim objUser as new MyUserCtr
objUser.getProducts(
Panel1.Controls.Add(objUser
nex
The method "getProducts" connect to Acces 2003 DB every time and ge
DataReader containing required data
 
M

Miha Markic [MVP C#]

Hi,

What exactly does getProducts do?

--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

A. Moghazy said:
Hi,
I did.
objReader.close()
objReader = nothing
objConn.close()
objConn = nothing

The error still exist.
Note: in Windows Task Manager the "PF Usage" reachess 700 MB every time when this error occured.

----- Miha Markic [MVP C#] wrote: -----

Hi,

You are not closing DataReaders or/and Connection instances.

--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

A. Moghazy said:
I have a loop to create instances of my user control at run time,
for
example:
for intPageCounter=0 to intNumberOfPages
dim objUser as new MyUserCtrl
objUser.getProducts()
Panel1.Controls.Add(objUser)
next
The method "getProducts" connect to Acces 2003 DB every time and
get
DataReader containing required data.
System.Data.OleDb.OleDbException: System resource exceeded.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top