Author: anagappan
Date: 2007-06-21 09:09:49 -0400 (Thu, 21 Jun 2007)
New Revision: 80465

Modified:
   trunk/mcs/class/System.Data/System.Data.Common/ChangeLog
   trunk/mcs/class/System.Data/System.Data.Common/DbConnectionStringBuilder.cs
Log:
2007-06-21  Nagappan A  <[EMAIL PROTECTED]>

        * DbConnectionStringBuilder.cs (Init): Modified the dictionary to
        use StringComparer.InvariantCultureIgnoreCase.
        (Add, ContainsKey): Checks whether argument is null or empty string.



Modified: trunk/mcs/class/System.Data/System.Data.Common/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/System.Data.Common/ChangeLog    2007-06-21 
13:06:51 UTC (rev 80464)
+++ trunk/mcs/class/System.Data/System.Data.Common/ChangeLog    2007-06-21 
13:09:49 UTC (rev 80465)
@@ -1,3 +1,9 @@
+2007-06-21  Nagappan A  <[EMAIL PROTECTED]>
+
+       * DbConnectionStringBuilder.cs (Init): Modified the dictionary to
+       use StringComparer.InvariantCultureIgnoreCase.
+       (Add, ContainsKey): Checks whether argument is null or empty string.
+
 2007-05-08  Adar Wesley <[EMAIL PROTECTED]>
 
        * DbProviderFactory.cs: minor refactoring for throwing exceptions

Modified: 
trunk/mcs/class/System.Data/System.Data.Common/DbConnectionStringBuilder.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.Common/DbConnectionStringBuilder.cs 
2007-06-21 13:06:51 UTC (rev 80464)
+++ trunk/mcs/class/System.Data/System.Data.Common/DbConnectionStringBuilder.cs 
2007-06-21 13:09:49 UTC (rev 80465)
@@ -59,7 +59,7 @@
 
                 private void Init ()
                 {
-                        _dictionary = new Dictionary<string, object> ();
+                        _dictionary = new Dictionary <string, object> 
(StringComparer.InvariantCultureIgnoreCase);
                 }
 
                 #endregion // Constructors
@@ -130,7 +130,7 @@
                                 if (ContainsKey (keyword))
                                         return _dictionary [keyword];
                                 else
-                                        throw new ArgumentException ();
+                                        throw new ArgumentException ("Keyword 
does not exist");
                         }
                         set { Add (keyword, value); }
                 }
@@ -171,6 +171,10 @@
 
                 public void Add (string keyword, object value)
                 {
+                       if (keyword == null || keyword.Trim () == "")
+                               throw new ArgumentException ("Keyword should 
not be emtpy");
+                       if (value == null)
+                               throw new ArgumentException ("Keyword not 
supported", keyword);
                         if (ContainsKey (keyword)) {
                                 _dictionary [keyword] = value;
                         } else {
@@ -209,6 +213,8 @@
 
                 public virtual bool ContainsKey (string keyword)
                 {
+                       if (keyword == null)
+                               throw new ArgumentNullException ("Invalid 
argument", keyword);
                         return _dictionary.ContainsKey (keyword);
                 }
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to