There are two DataTable objects datatable1 and datatable2. How to get the output of a LINQ query similar to a SQL SELECT * FROM table1 INNER JOIN table2 ON condition in a new DataTable? How to do the INNER JOIN and even the OUTER JOIN clear.
from table1 in datatable1.AsEnumerable() join table2 in datatable2.AsEnumerable() on (int)table1["anID"] equals (int)table2["anID"] select new { A = (int)table1["A"], B = (int)table1["B"], C = (int)table2["C"], D = (int)table2["D"] }; But how to get the result in the new DataTable, while not listing the example field does not come across.
PS The question is not about working with the database, but about the possibilities of c # + linq
INNER JOINbetween tables from differentdatatable1anddatatable2? - Olegselect new { table1, table2}otherwise only manually specify fields - GrundyINNER JOINbetween tables from differentdatatable1anddatatable2, from different SQL servers is a task that can be solved either through AsEnumerable, which is ineffective, or by creating, for example, Linked Servers . So what is there to find out by chance here isdatatable1anddatatable2- Oleg