// Author:
// Daniel Morgan <danmorg@sc.rr.com>
// Alan Tam Siu Lung <Tam@SiuLung.com>
+// Tim Coleman <tim@timcoleman.com>
//
// (C) 2002 Daniel Morgan
// (C) 2002 Ximian, Inc.
+// Copyright (C) Tim Coleman, 2003
//
using System;
/// DataRelation is used for a parent/child relationship
/// between two DataTable objects
/// </summary>
+ [Editor]
[DefaultProperty ("RelationName")]
[Serializable]
public class DataRelation {
public DataRelation (string relationName, DataColumn[] parentColumns, DataColumn[] childColumns, bool createConstraints)
{
this.extendedProperties = new PropertyCollection();
- if (relationName == null) relationName = "Relation";
+ if (relationName == null) relationName = string.Empty;
this.relationName = relationName;
if (parentColumns == null) throw new ArgumentNullException ();
this.parentColumns = parentColumns;
this.childColumns = childColumns;
this.createConstraints = createConstraints;
if (parentColumns.Length != childColumns.Length)
- throw new InvalidConstraintException ();
+ throw new ArgumentException ("ParentColumns and ChildColumns should be the same length");
DataTable parentTable = parentColumns[0].Table;
DataTable childTable = childColumns[0].Table;
if (parentTable.DataSet != childTable.DataSet)
throw new NotImplementedException ();
}
+#if NET_1_2
+ [MonoTODO]
+ public DataRelation (string relationName, string parentTableName, string parentTableNamespace, string childTableName, string childTableNamespace, string[] parentColumnNames, string[] childColumnNames, bool nested)
+ {
+ throw new NotImplementedException ();
+ }
+#endif
+
#endregion // Constructors
#region Properties
parentKeyConstraint = uniqueConstraint;
}
+ internal void SetDataSet(DataSet ds) {
+ dataSet = ds;
+ }
+
public virtual DataTable ParentTable {
get {
return parentColumns[0].Table;
protected internal void OnPropertyChanging (PropertyChangedEventArgs pcevent)
{
if (onPropertyChangingDelegate != null)
- onPropertyChangingDelegate.Invoke(this, pcevent);
+ onPropertyChangingDelegate (this, pcevent);
}
protected internal void RaisePropertyChanging (string name)