Questo esempio di codice seguente è preso a prestito da MSDN here. Non sto ottenendo query.CopyToDataTable() disponibile nel mio codice. (vedi la riga commentata nel mio codice seguente).Perché non ottengo .CopyToDataTable() in Linq Query()
public static bool SetPhysicianAsNotonServer(DataTable dt)
{
DataTable dtPhysicianServer = dt;
DataTable dtPhysicianClient = GetPhysicianClient();
var query =
from SPhysician in dtPhysicianServer.AsEnumerable()
join CPhysician in dtPhysicianClient.AsEnumerable()
on SPhysician.Field<string>("PhysicianNumber") equals
CPhysician.Field<string>("PhysicianNumber")
select new
{
PhysicianNumber = CPhysician.Field<string>("PhysicianNumber")
};
DataTable FilterDt = query; //query.CopyToDataTable();
//YET TO DO CODE HERE
return true;
}
Se si tenta di chiamare 'CopyToDataTable()' quale messaggio di errore ricevi? –