From: Vladislav P. <pa...@ma...> - 2008-01-06 02:00:52
|
Hi! I have to return FbDataReader object from function. So I write this: public static FbDataReader getReader(string sql) FbConnection conn = new FbConnection(MF.constr); FbCommand command = new FbCommand(sql, conn); conn.Open(); FbDataReader reader = command.ExecuteReader(); return reader; } But when I run the application and rise the function many times per minute I've grtting "Timeout exceed" exception write on conn.Open() method rising. I think this because of I havn't close the connection and garbage collector do not clean the memory quickly enought, but I can't to rise conn.Close() before I return reader. So what should I do to solve this problem? Vlad Panteleev, http://panvladislav.1gb.ru http://mobile.1gb.ru |