.NET DB Query Without Allocations?

Posted by Michael Covelli on Stack Overflow See other posts from Stack Overflow or by Michael Covelli
Published on 2010-04-10T20:56:33Z Indexed on 2010/04/10 21:03 UTC
Read the original article Hit count: 95

Filed under:
|
|
|

I have been given the task of re-writing some libraries written in C# so that there are no allocations once startup is completed.

I just got to one project that does some DB queries over an OdbcConnection every 30 seconds. I've always just used .ExecuteReader() which creates an OdbcDataReader. Is there any pattern (like the SocketAsyncEventArgs socket pattern) that lets you re-use your own OdbcDataReader? Or some other clever way to avoid allocations?

I haven't bothered to learn LINQ since all the dbs at work are Oracle based and the last I checked, there was no official Linq To Oracle provider. But if there's a way to do this in Linq, I could use one of the third-party ones.

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET