List:Commits« Previous MessageNext Message »
From:rburnett Date:November 6 2007 7:43pm
Subject:Connector/NET commit: r1080 - branches/5.0/Driver/Source
View as plain text  
Modified:
   branches/5.0/Driver/Source/parameter_collection.cs
Log:
fixed a problem with our earlier parameter collection changes that would manifest if you tried to index the parameters but had not assigned a connection

Modified: branches/5.0/Driver/Source/parameter_collection.cs
===================================================================
--- branches/5.0/Driver/Source/parameter_collection.cs	2007-11-06 17:24:02 UTC (rev 1079)
+++ branches/5.0/Driver/Source/parameter_collection.cs	2007-11-06 19:43:21 UTC (rev 1080)
@@ -36,6 +36,7 @@
 #endif
 	public sealed class MySqlParameterCollection : DbParameterCollection
 	{
+        private const char DefaultParameterMarker = '?';
         private ArrayList items = new ArrayList();
         private Hashtable indexHash;
         private MySqlCommand owningCommand;
@@ -54,7 +55,12 @@
 
 		internal char ParameterMarker
 		{
-			get { return owningCommand.Connection.ParameterMarker; }
+			get 
+            { 
+                return owningCommand.Connection != null ? 
+                owningCommand.Connection.ParameterMarker : 
+                DefaultParameterMarker; 
+            }
 		}
 
 		#region Public Methods

Thread
Connector/NET commit: r1080 - branches/5.0/Driver/Sourcerburnett6 Nov