private bool IsSelfRelatedDataTable(DataTable rootTable)
{
List<DataTable> tableList = new List<DataTable>();
bool retValue = false;
foreach (DataRelation r in rootTable.ChildRelations)
{
DataTable childTable = r.ChildTable;
if (childTable == rootTable)
{
retValue = true;
break;
}
else if (!tableList.Contains(childTable))
{
tableList.Add(childTable);
}
}
if (!retValue)
{
for (int counter = 0; counter < tableList.Count; counter++)
{
foreach (DataRelation r in tableList[counter].ChildRelations)
{
DataTable childTable = r.ChildTable;
if (childTable == rootTable)
{
retValue = true;
break;
}
else if (!tableList.Contains(childTable))
{
tableList.Add(childTable);
}
}
if (retValue)
{
break;
}
}
}
return retValue;
}
private bool TablesAreOrdered(DataSet ds)