views:

37

answers:

1
+1  Q: 

my site show error

my site show this error

you can also check online it visit only 4 to 5 pages then http://www.pakcarid.com/

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

Source Error:

Line 267:            OleDbDataAdapter dtt = new OleDbDataAdapter(tot);
Line 268:            DataSet dstt = new DataSet();
Line 269:            dtt.Fill(dstt);
Line 270:
Line 271:            this.totalview.Text = dstt.Tables[0

can any one tell my how to solve it

A: 

Are you closing your DataAdapters? You need to either explicitly call dtt.Close() or use using blocks (they're IDisposable):

DataSet dstt = new DataSet();
using(OleDbDataAdapter dtt = new OleDbDataAdapter(tot))
{
    dtt.Fill(dstt);
    dtt.Close();
}

etc. The Close() is redundant here because the using block will call dtt.Dispose() but I prefer to leave it in anyway.

Most ADO.NET objects are IDisposable; whereas I doubt some of these matter whether you close and dispose them or not (e.g. Commands) I expect DataAdapters, connections, etc. do.

Rup
i make it dispose i am not shure that it is a exact error
azeem
OK, sorry that didn't help. Here's the MSDN article on connection pooling in case you haven't seen it: assuming you're using the same connection string for all connections it should pool automatically but suggests you close connections as soon as you're done with them. http://msdn.microsoft.com/en-us/library/ms254502.aspx. It might be worth trying to debug into the OleDb library to see exactly what resource it has run out of if you can - I'm not sure if the source is on the Microsoft symbol servers or not.
Rup