DataTable.Select
-
In .NET 2.0, assume that I have some SQL written along the lines of: Select child.name, parent.name From person child, person parent On child.ParentId = parent.Id Where child.category = 55 I now have to convert this SQL so that it selects from a cached DataTable of people instead of directly from the database. Is there an elegant way to convert this SQL using DataTable.Select (or some other DataTable method)? (I realize that if there was just one Person in the SQL statement this would be simple.)
-
In .NET 2.0, assume that I have some SQL written along the lines of: Select child.name, parent.name From person child, person parent On child.ParentId = parent.Id Where child.category = 55 I now have to convert this SQL so that it selects from a cached DataTable of people instead of directly from the database. Is there an elegant way to convert this SQL using DataTable.Select (or some other DataTable method)? (I realize that if there was just one Person in the SQL statement this would be simple.)
If you've got relationships setup, you'll need to do something found at: Select Statement Syntax[^] Look for the section - "PARENT/CHILD RELATION REFERENCING"