2002-11-03 Ville Palo <vi64pa@koti.soon.fi>
authorVille Palo <ville@mono-cvs.ximian.com>
Sun, 3 Nov 2002 16:37:04 +0000 (16:37 -0000)
committerVille Palo <ville@mono-cvs.ximian.com>
Sun, 3 Nov 2002 16:37:04 +0000 (16:37 -0000)
* System.Data.SqlTypes/SqlBinary.cs: Finished and no errors generated
by NUnitConsole_mono.exe

svn path=/trunk/mcs/; revision=8801

mcs/class/System.Data/ChangeLog
mcs/class/System.Data/System.Data.SqlTypes/SqlBinary.cs

index 3af5b019ce4e21ec6dd6e5f694ad5ee7262023b8..42e47571606cbed65b0f27a264eef7d9e471f935 100644 (file)
@@ -1,3 +1,8 @@
+2002-11-03  Ville Palo <vi64pa@koti.soon.fi>
+
+       * System.Data.SqlTypes/SqlBinary.cs: Finished and no errors generated
+       by NUnitConsole_mono.exe
+       
 2002-11-03  Tim Coleman (tim@timcoleman.com)
        * System.Data.SqlClient/SqlCommand.cs:
                Use SET NO_BROWSETABLE ON when CommandBehavior is KeyInfo
index ef4caa8f4db1551e91e237cca11505a784c37208..2f30cc870703d6599bf9a6d890009d4b20df8ee6 100644 (file)
@@ -100,6 +100,8 @@ namespace System.Data.SqlTypes
                {
                        if (!(value is SqlBinary))
                                return false;
+                       else if (((SqlBinary)value).IsNull)
+                               return false;
                        else
                                return (bool) (this == (SqlBinary)value);
                }
@@ -157,12 +159,7 @@ namespace System.Data.SqlTypes
 
                public override string ToString () 
                {
-                       string result = "";;
-                       
-                       foreach (char c in value)
-                               result += c;
-                       
-                       return result;
+                       return "SqlBinary(" + value.Length + ")";
                }
 
                #endregion
@@ -176,14 +173,15 @@ namespace System.Data.SqlTypes
                        int j = 0;
                        int i;
 
-                       for (i = 0; i < x.Value.Length; i++)
+                       for (i = 0; i < x.Value.Length; i++) 
                                b [i] = x.Value [i];
+                       
 
-                       for ( ; i < (x.Value.Length + y.Value.Length -1); i++) {
-                               b [i] = y.Value [0];
+                       for (; i < (x.Value.Length + y.Value.Length); i++) {
+                               b [i] = y.Value [j];
                                j++;
                        }       
-
+                       
                        return new SqlBinary (b);
                }
                        
@@ -192,7 +190,7 @@ namespace System.Data.SqlTypes
                        if (x.IsNull || y.IsNull) 
                                return SqlBoolean.Null;
                        else
-                               return x.Value.Equals (y.Value);
+                               return new SqlBoolean (Compare (x, y) == 0);
                }
 
                public static SqlBoolean operator > (SqlBinary x, SqlBinary y) 
@@ -216,7 +214,7 @@ namespace System.Data.SqlTypes
                        if (x.IsNull || y.IsNull) 
                                return SqlBoolean.Null;
                        else
-                               return !x.Value.Equals (y.Value);
+                               return new SqlBoolean (Compare (x, y) != 0);
                }
 
                public static SqlBoolean operator < (SqlBinary x, SqlBinary y)