This following code example is borrowed from MSDN here. I am not getting query.CopyToDataTable() available in my code. (see the commented line in my following code).
I think that's because your creating a anonymous type to hold the Field
object.
Try this:
var query = from SPhysician in dtPhysicianServer.AsEnumerable()
join CPhysician in dtPhysicianClient.AsEnumerable()
on SPhysician.Field("PhysicianNumber") equals
CPhysician.Field("PhysicianNumber")
select CPhysician;
DataTable FilterDt = query.CopyToDataTable();
Definition of CopyToDataTable
:
public static DataTable CopyToDataTable(
this IEnumerable source
)
where T : DataRow
So what you select with the query must be of type IEnumerable
where T
extends DataRow