This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 44843 - SqlCommand.ExecuteReaderAsync throws NotImplementedException
Summary: SqlCommand.ExecuteReaderAsync throws NotImplementedException
Alias: None
Product: Class Libraries
Classification: Mono
Component: Sys.Data (show other bugs)
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
Modified: 2016-10-04 19:05 UTC (History)
6 users (show)

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


Description Jon Goldberger 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 :

Environment info and IDE Logs :

Application output :

Hence, reopening this issue.

Comment 7 Brendan Zagaeski (Xamarin Support) 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]:


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.


Note You need to log in before you can comment on or make changes to this bug.