• Florian Reischl (5/13/2009)


    Nish (5/13/2009)


    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.

    Hi Nish

    I have no idea what you mean with "JobCount.JobCount" for your GUI. If you use a DataTable (or a DataReader) you get only "JobCount" as result column, don't you?

    Greets

    Flo

    Sorry for not explaining properly,

    To sort on Jobcount , i have to write "(ORDER BY j.JobCount)" , but as you said datatable does not know the table prifix, same with sort on company i'll have to pass "(ORDER BY C.CompanyId" )" , so i cant know the table alias on the runtime. is there any workaround, i guess not. but anyother method where i dont have to pass the table alias.

    Thanks,

    Nish.