There is already an open DataReader associated with this Conne ction which must be closed first. 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.