Re: MySqlDataReader, .NET 2.0
Adis,
Not sure if you are still working on this but I ran across the same thing:
Error Message: Error in the NUnit test:
MySql.Data.MySqlClient.MySqlException: There is already an open DataReader associated with this Connection which must be closed first.
at MySql.Data.MySqlClient.MySqlCommand.CheckState() in C:\Program Files\MySQL\MySQL Connector Net 1.0.7\src\MySqlClient\command.cs:line 332
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) in C:\Program Files\MySQL\MySQL Connector Net 1.0.7\src\MySqlClient\command.cs:line 383
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader() in C:\Program Files\MySQL\MySQL Connector Net 1.0.7\src\MySqlClient\command.cs:line 376
at MySql.Data.MySqlClient.Driver.ReportWarnings() in C:\Program Files\MySQL\MySQL Connector Net 1.0.7\src\MySqlClient\Driver.cs:line 280
at MySql.Data.MySqlClient.CommandResult.ReadNextResult(Boolean isFirst) in C:\Program Files\MySQL\MySQL Connector Net 1.0.7\src\MySqlClient\CommandResult.cs:line 143
at MySql.Data.MySqlClient.MySqlCommand.GetNextResultSet(MySqlDataReader reader) in C:\Program Files\MySQL\MySQL Connector Net 1.0.7\src\MySqlClient\command.cs:line 261
at MySql.Data.MySqlClient.MySqlDataReader.NextResult() in C:\Program Files\MySQL\MySQL Connector Net 1.0.7\src\MySqlClient\datareader.cs:line 683
at System.Data.ProviderBase.DataReaderContainer.NextResult()
at System.Data.Common.DataAdapter.FillNextResult(DataReaderContainer dataReader)
at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
at System.Data.Common.DataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
at DevTests.CalendarTestFixture.GetEventsForMonth(Int32 year, Int32 month) in C:\Documents and Settings\mark\My Documents\Visual Studio 2005\Projects\Calendar\DevTests\CalendarTestFixture.cs:line 133
I was doing a query comparing a date value with a date field. The "gotcha" was in the difference of date formats between a MySql date field and a .Net DateTime object. MySql date field - yyyy-mm-dd and the DateTime object - mm-dd-yyyy. Once I formated the date passed into the query to yyyy-mm-dd it worked.
Hope this may shed some light on your situation.
m2web