• this solves the problem, but it seems there's another one.

    the order by column and page numbers come from UI(ASP.NET), so it'll only send column name i.e "JobCount" , but in the query it needs to be written like "JobCount.JobCount" or "Company.CompanyID" , my UI does not understand this and there are 6 different columns which comes from 3 different tables.

    Is there any workaround?

    Thanks In Advance,

    Nish.