Bug 36099 - NullReferenceExceptoin with SqlDataAdapter.Fill
Summary: NullReferenceExceptoin with SqlDataAdapter.Fill
Status: RESOLVED DUPLICATE of bug 35857
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Data (show other bugs)
Version: 4.2.0 (C6)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-11-20 10:22 UTC by sweissman
Modified: 2017-09-06 16:59 UTC (History)
7 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Screen Snap of trying to load .asmx page in chrome. (131.34 KB, image/png)
2015-11-20 11:43 UTC, Tony
Details


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:
Status:
RESOLVED DUPLICATE of bug 35857

Description sweissman 2015-11-20 10:22:35 UTC
I'm getting a NullReference exception from the following, which works fine in 4.0.5.


// Return the result of a query is a dataset
DataSet ds = new DataSet ();

// Issue Query
using (SqlCommand sqlcmd = new SqlCommand(sSqlCommand, dbConn))
{
   SqlDataAdapter sqlda = new SqlDataAdapter(sqlcmd);

   // Set Query Timeout
   sqlcmd.CommandTimeout = 900;

   // Fill the dataset
   sqlda.Fill(ds);
}

I'm not sure if this matters, but the command that we're running is a stored procedure in a MS SqlServer database.

System.NullReferenceException: Object reference not set to an instance of an object
  at System.Data.SqlClient.SqlDataReader.GetValues (System.Object[] values) [0x00021] in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs:1266 
  at System.Data.ProviderBase.DataReaderContainer+CommonLanguageSubsetDataReader.GetValues (System.Object[] values) [0x00000] in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/external/referencesource/System.Data/System/Data/ProviderBase/DataReaderContainer.cs:129 
  at System.Data.ProviderBase.SchemaMapping.LoadDataRow () [0x00000] in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/external/referencesource/System.Data/System/Data/ProviderBase/SchemaMapping.cs:342 
  at System.Data.Common.DataAdapter.FillLoadDataRow (System.Data.ProviderBase.SchemaMapping mapping) [0x00069] in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/external/referencesource/System.Data/System/Data/Common/DataAdapter.cs:645 
  at System.Data.Common.DataAdapter.FillFromReader (System.Data.DataSet dataset, System.Data.DataTable datatable, System.String srcTable, System.Data.ProviderBase.DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, System.Data.DataColumn parentChapterColumn, System.Object parentChapterValue) [0x00089] in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/external/referencesource/System.Data/System/Data/Common/DataAdapter.cs:561 
  at System.Data.Common.DataAdapter.Fill (System.Data.DataSet dataSet, System.String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) [0x00093] in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/external/referencesource/System.Data/System/Data/Common/DataAdapter.cs:442 
  at System.Data.Common.DbDataAdapter.FillInternal (System.Data.DataSet dataset, System.Data.DataTable[] datatables, Int32 startRecord, Int32 maxRecords, System.String srcTable, IDbCommand command, CommandBehavior behavior) [0x00064] in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/external/referencesource/System.Data/System/Data/Common/DbDataAdapter.cs:539 
  at System.Data.Common.DbDataAdapter.Fill (System.Data.DataSet dataSet, Int32 startRecord, Int32 maxRecords, System.String srcTable, IDbCommand command, CommandBehavior behavior) [0x00074] in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/external/referencesource/System.Data/System/Data/Common/DbDataAdapter.cs:436 
  at System.Data.Common.DbDataAdapter.Fill (System.Data.DataSet dataSet) [0x00025] in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/external/referencesource/System.Data/System/Data/Common/DbDataAdapter.cs:382
Comment 1 Tony 2015-11-20 11:35:31 UTC
Probably related:  I am getting System.ArgumentNullException when trying to load .asmx page that loads fine in mono 4.0.4:


Application Exception
System.ArgumentNullException
Value cannot be null.
Parameter name: path1

Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object): mscorlib.
Exception stack trace:
  at System.IO.Path.Combine (System.String path1, System.String path2) [0x00006] in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/mcs/class/corlib/System.IO/Path.cs:101 
  at System.Web.Services.Configuration.WsdlHelpGeneratorElement.get_HelpGeneratorPath () [0x00000] in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/external/referencesource/System.Web.Services/System/Web/Services/Configuration/WsdlHelpGeneratorElement.cs:39 
  at System.Web.Services.Protocols.DocumentationServerProtocol.Initialize () [0x001dc] in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/external/referencesource/System.Web.Services/System/Web/Services/Protocols/DocumentationServerProtocol.cs:135 
  at System.Web.Services.Protocols.ServerProtocol.SetContext (System.Type type, System.Web.HttpContext context, System.Web.HttpRequest request, System.Web.HttpResponse response) [0x00022] in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/external/referencesource/System.Web.Services/System/Web/Services/Protocols/ServerProtocol.cs:50 
  at System.Web.Services.Protocols.ServerProtocolFactory.Create (System.Type type, System.Web.HttpContext context, System.Web.HttpRequest request, System.Web.HttpResponse response, System.Boolean& abortProcessing) [0x00014] in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/external/referencesource/System.Web.Services/System/Web/Services/Protocols/ServerProtocol.cs:310 
Version Information: 4.2.1 (explicit/6dd2d0d Fri Nov 6 12:25:19 EST 2015); ASP.NET Version: 4.0.30319.17020
Comment 2 Tony 2015-11-20 11:43:03 UTC
Created attachment 13917 [details]
Screen Snap of trying to load .asmx page in chrome.
Comment 3 Rodrigo Kumpera 2015-11-27 18:05:36 UTC
Hey Marcos,

Could you look at this one?

Ludo,

CC'ing you because this might be a regression in the begin/end invoke code.
Comment 4 Brendan Zagaeski (Xamarin Team, assistant) 2015-12-03 22:07:51 UTC
Comment 1 appears to be a different bug. It should perhaps be re-filed separately. Based on the stack trace, Comment 0 appears to be a duplicate of Bug 35857.
Comment 5 Marek Safar 2017-09-06 16:59:14 UTC

*** This bug has been marked as a duplicate of bug 35857 ***