c# datareader already open visual studio mysql code example
Example: c# datareader already open visual studio mysql
// Always, always, always put disposable objects inside of using statements:
using (Connection c = ...)
{
using (DataReader dr = ...)
{
//Work with dr in here.
}
}
//Now the connection and reader have been closed and disposed.