DLINQ

J

Jacek Jurkowski

How to specify orderby columns in DLINQ query dynamically at runtime?

Query bellow is ordered by K_OSOBY.NAZWISKO, K_OSOBY.IMIE columns
but method parameter specifies where it should be ordered by K_OSOBY.NREWID.
HowTo change orderby of this at runtime?

var query = from K_OSOBY in aDC.K_OSOBies
join K_K1 in aDC.K_K1s on K_OSOBY.NREWID equals
K_K1.NREWID into subQuery
from K_K1 in subQuery.DefaultIfEmpty()
orderby K_OSOBY.NAZWISKO, K_OSOBY.IMIE
select new
{
K_OSOBY.ADRES,
K_OSOBY.DATRUM,
K_OSOBY.DATUR,
K_OSOBY.GUID,
K_OSOBY.ID,
K_OSOBY.IMIE,
K_OSOBY.NAZWISKO,
K_OSOBY.NIP,
K_OSOBY.NR_AKT,
K_OSOBY.NREWID,
K_OSOBY.PESEL,
K_OSOBY.SPRUM,
K_K1.DKDU,
K_K1.DPDU,
K_K1.DR,
K_K1.DU,
K_K1.FORMAUM,
K_K1.KM,
K_K1.ST
};
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top