Data Access has been discontinued. Please refer to this page for more information.


The MetaConstraint class represents a foreign key constraint in the underlying database. The source and destination tables are specified by the Source and Destination properties. Columns that participate in the constraint are referenced with the SourceColumns collection property.

The following examples shows you how to get information about the constraints in the relational part of your model:

private string GetConstraints(Telerik.OpenAccess.Metadata.MetadataContainer container)
   StringBuilder sb = new StringBuilder();
   foreach (MetaConstraint constraint in container.Constraints)
       sb.AppendFormat("\nDestinationTable: {0}", constraint.DestinationTable.Name);
       sb.AppendFormat("\nSourceTable: {0}", constraint.SourceTable.Name);
   return sb.ToString();
Private Function GetConstraints(ByVal container As Telerik.OpenAccess.Metadata.MetadataContainer) As String
 Dim sb As New StringBuilder()
 For Each constraint As MetaConstraint In container.Constraints
  sb.AppendFormat(vbLf & "DestinationTable: {0}", constraint.DestinationTable.Name)
  sb.AppendFormat(vbLf & "SourceTable: {0}", constraint.SourceTable.Name)
 Next constraint
 Return sb.ToString()
End Function