[Mono-bugs] [Bug 60052][Nor] New - DataRow.SetValuesFromDataRecord bug

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 11 Jun 2004 15:15:18 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by carlosga@telefonica.net.

http://bugzilla.ximian.com/show_bug.cgi?id=60052

--- shadow/60052	2004-06-11 15:15:18.000000000 -0400
+++ shadow/60052.tmp.16933	2004-06-11 15:15:18.000000000 -0400
@@ -0,0 +1,43 @@
+Bug#: 60052
+Product: Mono: Class Libraries
+Version: unspecified
+OS: GNU/Linux [Other]
+OS Details: Fedora Core 1
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.Data
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: carlosga@telefonica.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: DataRow.SetValuesFromDataRecord bug
+
+Thr problem gives trying to fill a dataaset using the Firebird .NET provider.
+
+One of the rows returns a null value for an Int16 field and is raising an
+exception in a call done in the DataRow.SetValuesFromDataRecord:
+
+column.DataContainer.SetItemFromDataRecord(_proposed, record,mapping[i]);
+
+The SetItemFromDataRecord method will do a call to IDataReader.GetInt16
+*without* check if the value is null (mandatory in this case, for example
+the SqlDataReader.GetInt16 states "Call IsDBNull to check for null values
+before calling this method.", the same applies to GetInt32, GetByte,
+GetDateTime, ...)
+
+A comment in the Int16DataContainer.SetItemFromDataRecord tells that
+exception should be cached in the caller method, that isn't being done in
+the DataRow.SetValuesFromDataRecord.
+
+I think the best will be to call the IsDBNull method of the DataReader
+instance in the DataRow method.
+
+
+
+The sample sample code works fine in .NET
+
+( If needed i can provider a test case )