Bug 44843 - SqlCommand.ExecuteReaderAsync throws NotImplementedException
Summary: SqlCommand.ExecuteReaderAsync throws NotImplementedException
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Data ()
Version: 4.6.0 (C8)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: 4.8.0 (C9)
Assignee: Marek Safar
Depends on:
Reported: 2016-09-28 19:36 UTC by Jon Goldberger [MSFT]
Modified: 2016-10-04 19:05 UTC (History)
6 users (show)

Is this bug a regression?: Yes
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jon Goldberger [MSFT] 2016-09-28 19:36:04 UTC
## Description

A customer reports that after updating to Cycle 8 that SqlCommand.ExecuteReaderAsync is throwing a NotImplementedException where it did not in Cycle 7.

A bit of investigation revealed that prior to Mono 4.6.0, there was no SqlCommand.ExecuteReaderAsync (namespace System.Data.SqlClient) implementation and instead that method, with overloads, was inherited from the abstract base class DbCommand.ExecuteReaderAsync (namespace System.Data.Common) and ExecuteReaderAsync is implemented in DbCommand so prior to Mono 4.6 calling SqlCommand.ExecuteReaderAsync worked as the implementation in DbCommand was used. But in Mono 4.6 (and in the master branch) the implementations in SqlCommand.ExecuteReaderAsync hide the base implementations and the new implementation only throws a NotImplementedException.

See Mono 4.6 System.Data.SqlClient.SqlCommand.ExecuteReaderAsync:

and Mono 4.5.1 System.Data.SqlClient.SqlCommand.ExecuteReader (the Async version does not exist)

and also Mono master System.Data.Common.DbCommand.ExecuteReader:

## Steps to reproduce

I don't think this is needed, but there is a test project I can provide from the desk case if need be. 

## Environment

Again I don't think this is needed, but issue occurs with latest C8 and C8 SR0 builds, which include Mono 4.6.
Comment 2 Marek Safar 2016-09-30 10:11:21 UTC
Fixed in master and Mono 4.8
Comment 6 Mohit Kheterpal 2016-10-04 18:13:19 UTC
I have checked this issue with latest build of master i.e. MonoFramework-MDK- and observed that this issue still exist 

Exception Error : https://gist.github.com/Mohit-Kheterpal/eac79ce416507c82376230718b8b8284

Environment info and IDE Logs : https://gist.github.com/Mohit-Kheterpal/d8dee622aa59dc9417bb2111d75159ba

Application output : https://gist.github.com/Mohit-Kheterpal/c979ed8c3866c9bc2b8da961fd2c4aa6

Hence, reopening this issue.

Comment 7 Brendan Zagaeski (Xamarin Team, assistant) 2016-10-04 18:47:58 UTC
You tested on iOS.  The fix is in the class libraries, so the version of Mono that you would need to report as having tested would be the version included _within_ Xamarin.iOS.

You tested with Xamarin.iOS 66915a0, which includes Mono 8f689a60fe814554e4958d67582ba5ec230c03f5 [1].

Mono 8f689a60fe814554e4958d67582ba5ec230c03f5 predates the changes mentioned in Comment 2 [2]:

[1] https://github.com/xamarin/xamarin-macios/tree/66915a01c028b7a9f749c72de9fd353307e56437/external

[2] https://github.com/mono/mono/commit/aebd704d799a1081cd71f5e58d7a7a96d6f92663
Comment 8 Mohit Kheterpal 2016-10-04 19:05:02 UTC
I got the expected output with Mono sample provided in comment 5 using MonoFramework-MDK-

Hello World!
Results: 232	139
Results: 233	128
Results: 234	109
Results: 235	108
Results: 236	135

Hence closing this issue by marking it as Verified.