+2005-01-24 Atsushi Enomoto <atsushi@ximian.com>
+
+ * DataColumn.cs : set_MaxLength is not allowed when it is mapped to
+ SimpleContent. (However, it is weird but it never fails when we set
+ ColumnMapping = MappingType.SimpleContent when we have MaxLength.)
+
2005-01-21 Atsushi Enomoto <atsushi@ximian.com>
* DataRow.cs : more Current -> Default fixes. Check if it should throw
return maxLength;
}
set {
+ if (_columnMapping == MappingType.SimpleContent)
+ throw new ArgumentException (String.Format ("Cannot set MaxLength property on '{0}' column which is mapped to SimpleContent.", ColumnName));
//only applies to string columns
maxLength = value;
}
+2005-01-24 Atsushi Enomoto <atsushi@ximian.com>
+
+ * DataColumnTest.cs : Added SetMaxLength().
+
2005-01-24 Atsushi Enomoto <atsushi@ximian.com>
* store2.xsd, store3.xsd, store4.xsd : Added.
AssertEquals ("DC76", "False", T.Rows [4] [2]);
AssertEquals ("DC77", "True", T.Rows [1] [2]);
}
-
- [Test]
+
+ [Test]
+ [ExpectedException (typeof (ArgumentException))]
+ public void SetMaxColumn ()
+ {
+ DataSet ds = new DataSet("Example");
+ ds.Tables.Add("MyType");
+ ds.Tables["MyType"].Columns.Add(new DataColumn("Desc",
+ typeof (string), "", MappingType.SimpleContent));
+ ds.Tables["MyType"].Columns["Desc"].MaxLength = 32;
+ }
+
+ [Test]
public void AdditionToConstraintCollectionTest()
{
DataTable myTable = new DataTable("myTable");