New tests.
[mono.git] / mcs / class / System.Data / System.Data / DataColumn.cs
index ecdc4a5f194dc6698cc0c4926fe1703ba6e47b71..f5d84c562206660cb3fd31da5f5c509a2422bf12 100644 (file)
@@ -405,15 +405,9 @@ namespace System.Data {
 \r
                                //Check AutoIncrement status, make compatible datatype\r
                                if(AutoIncrement == true) {\r
-                                       // we want to check that the datatype is supported?\r
-                                       // TODO: Is this the same as CanAutoIncrement or was the omission of Decimal intended?\r
-                                       TypeCode typeCode = Type.GetTypeCode(value);\r
-\r
-                                       if (typeCode != TypeCode.Int16 &&\r
-                                           typeCode != TypeCode.Int32 &&\r
-                                           typeCode != TypeCode.Int64) {\r
+                                       // we want to check that the datatype is supported?                                     \r
+                                       if (!CanAutoIncrement (value))\r
                                                AutoIncrement = false;\r
-                                       }\r
                                }\r
 \r
                                if (DefaultValue != GetDefaultValueForType (prevType))\r
@@ -707,7 +701,8 @@ namespace System.Data {
                        //Copy.Container\r
                        copy.DataType = DataType;\r
                        copy._defaultValue = _defaultValue;\r
-                       copy._expression = _expression;\r
+                       // Use the property to set the expression as it updates compiledExpression, if any.\r
+                       copy.Expression = _expression;\r
                        //Copy.ExtendedProperties\r
                        copy._maxLength = _maxLength;\r
                        copy._nameSpace = _nameSpace;\r
@@ -720,6 +715,7 @@ namespace System.Data {
                        if (DataType == typeof (DateTime))\r
                                copy.DateTimeMode = _datetimeMode;\r
 #endif\r
+                       copy._extendedProperties = _extendedProperties;\r
 \r
                        return copy;\r
                }\r