Developer Resources for AbleCommerce eCommerce platform
CommerceBuilder.Utility Namespace / DbHelper Class / ConstraintExists Method
the sql connection
Name of the table
Name of the constraint to check for
In This Topic
    ConstraintExists Method
    In This Topic
    Determines if a constraint exists for a database table
    Syntax
    public static bool ConstraintExists( 
       SqlConnection connection,
       string tableName,
       string constraintName
    )

    Parameters

    connection
    the sql connection
    tableName
    Name of the table
    constraintName
    Name of the constraint to check for

    Return Value

    True if the constraint exists for the table, false otherwise.
    Remarks
    This method assumes the table exists.
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also