[Mono-bugs] [Bug 77535][Nor] Changed - Sqlite DataReader's GetString crashes on null value in DB

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Feb 12 16:26:22 EST 2006


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 danielmorgan at verizon.net.

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

--- shadow/77535	2006-02-12 08:40:05.000000000 -0500
+++ shadow/77535.tmp.15921	2006-02-12 16:26:21.000000000 -0500
@@ -1,14 +1,14 @@
 Bug#: 77535
 Product: Mono: Class Libraries
 Version: 1.0
-OS: 
+OS: unknown
 OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Normal
 Component: Sys.Data
 AssignedTo: tsenganal at novell.com                            
 ReportedBy: nazgul at omega.pl               
 QAContact: mono-bugs at ximian.com
 TargetMilestone: ---
@@ -69,6 +69,24 @@
 
 How often does this happen? 
 Always
 
 Additional Information:
 It worked fine some time ago
+
+------- Additional Comments From danielmorgan at verizon.net  2006-02-12 16:26 -------
+You should be checking if the value is DBNull.Value before using
+GetString(i).  You do this by using IsDBNull(i).
+
+If the value is DBNull.Value and you still try to GetString(i),
+GetString(i) should be throwing InvalidOperationException.
+
+All the GetInt32(), GetDataTime(), etc... methods should do this.
+
+However, GetValue() should return DBNull.Value if the value is
+DBNull.Value.
+
+For a better understanding how a data reader should work, read up on
+SqlDataReader.
+
+
+


More information about the mono-bugs mailing list