}
}
+#if NET_1_2
+ [MonoTODO]
+ public DataTable this [string name, string tbNamespace] {
+ get { throw new NotImplementedException (); }
+ }
+#endif
+
protected override ArrayList List {
get { return list; }
}
NameTable (table);
// check if the collection has a table with the same name.
- if(Contains(table.TableName))
- throw new DuplicateNameException("A DataTable named '" + table.TableName + "' already belongs to this DataSet.");
-
+ int tmp = IndexOf(table.TableName);
+ // if we found a table with same name we have to check
+ // that it is the same case.
+ // indexof can return a table with different case letters.
+ if (tmp != -1)
+ {
+ if(table.TableName == this[tmp].TableName)
+ throw new DuplicateNameException("A DataTable named '" + table.TableName + "' already belongs to this DataSet.");
+ }
+
list.Add (table);
table.dataSet = dataSet;
OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, table));
return table;
}
+#if NET_1_2
+ public virtual DataTable Add (string name, string tbNamespace)
+ {
+ DataTable table = new DataTable (name, tbNamespace);
+ this.Add (table);
+ return table;
+ }
+#endif
+
public void AddRange (DataTable[] tables)
{
foreach (DataTable table in tables)
// loop on all constrains in the current table
while (constraintEnumerator.MoveNext())
{
- Object o = (Constraint) constraintEnumerator.Current;
+ Object o = constraintEnumerator.Current;
// we only check ForeignKeyConstraint
if (o is ForeignKeyConstraint)
{