Dela via


SyncSchemaForeignKeys.Add Method (String, String, array<String[], String, array<String )

Adds a SyncSchemaForeignKey object to the end of the collection, with the specified constraint name, parent table and columns, and child table and columns.

Namespace:  Microsoft.Synchronization.Data
Assembly:  Microsoft.Synchronization.Data (in Microsoft.Synchronization.Data.dll)

Syntax

'Declaration
Public Function Add ( _
    foreignKeyName As String, _
    parentTable As String, _
    parentColumns As String(), _
    childTable As String, _
    childColumns As String() _
) As SyncSchemaForeignKey
'Usage
Dim instance As SyncSchemaForeignKeys
Dim foreignKeyName As String
Dim parentTable As String
Dim parentColumns As String()
Dim childTable As String
Dim childColumns As String()
Dim returnValue As SyncSchemaForeignKey

returnValue = instance.Add(foreignKeyName, _
    parentTable, parentColumns, childTable, _
    childColumns)
public SyncSchemaForeignKey Add(
    string foreignKeyName,
    string parentTable,
    string[] parentColumns,
    string childTable,
    string[] childColumns
)
public:
SyncSchemaForeignKey^ Add(
    String^ foreignKeyName, 
    String^ parentTable, 
    array<String^>^ parentColumns, 
    String^ childTable, 
    array<String^>^ childColumns
)
member Add : 
        foreignKeyName:string * 
        parentTable:string * 
        parentColumns:string[] * 
        childTable:string * 
        childColumns:string[] -> SyncSchemaForeignKey 
public function Add(
    foreignKeyName : String, 
    parentTable : String, 
    parentColumns : String[], 
    childTable : String, 
    childColumns : String[]
) : SyncSchemaForeignKey

Parameters

  • foreignKeyName
    Type: System.String
    The name of the foreign key constraint.
  • parentColumns
    Type: System.String[]
    An array of the primary key or unique columns in the parent table.
  • childColumns
    Type: System.String[]
    An array of the foreign key columns in the child table.

Return Value

Type: Microsoft.Synchronization.Data.SyncSchemaForeignKey
The SyncSchemaForeignKey object that was added to the collection.

Exceptions

Exception Condition
ArgumentException
  • parentTable or childTable, does not belong to the current data set,

—or—

  • childColumns or parentColumns contains a column which does not belong to the current data set.

See Also

Reference

SyncSchemaForeignKeys Class

Add Overload

Microsoft.Synchronization.Data Namespace