I recently worked on a project in VB.NET and I ran into a mysterious problem with some of the DB connections. It was a project that I inherited from someone else, and they used something like this:
Dim reader As SqlDataReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection And CommandBehavior.SingleRow)
reader.Close()
This seems to cause the connection to not close properly all the time. I removed CommandBehavior.SingleRow and it seems to be working fine now, but I was wondering if anyone else came across this? Does anyone know why this will not work? I had seen CommandBehaviors before, but had never done it before.
Ender source
share