|
One of the things easily forgotten and under used is the "Using" statement. This is especially important when you have IDataReader implemented in your application as it doesn't always go away when you close it. Yes, you can adjust the connection to "Close" it, but I've found by creating your IDataReader with the Using statement, it goes away. No more running out of data readers.
VB
Using dr As IDataReader = db.ExecuteReader("dbo.SomeProcedure", Params)
.... your code
End Using
C#
using (IDataReader rdr = cmd.ExecuteReader())
{
.... Your Code
}
Very easy to implement and use.
Happy Coding!!