Function to determine if two tables are related <p>Suppose I have 5 table schemas in memory as DataTables and one other DataTable that is a schema of the referential constraints between the other 5 tables.</p> <p>The 5 schema tables are related such that Table A contains a primary key column related to a foreign key in B. B also contains a primary key column related to a foreign key column in C, and C to D, but suppose A,B,C, and D are not directly or indirectly related to E.</p> <p>What sort of function would take in two datatables and return a boolean value indicating whether those tables were related or 'linked'.</p> <p><strong>What I'm Trying To Accomplish</strong></p> <p>Suppose I present a user with all of the columns in the 5 tables in a drag and drop style interface. I want the user to be able to build a query a graphically, but I will need to enable/disable certain columns based on whether or not they can even be returned in the same select statement.</p>