Skip to content

Datagridview order problem

yokzu

Asked Sep 28, 2009, 2:19 AM EDT1 answer
Share
LinkedInX
Hi.
Datagridview showing my db's data. How can I show, last entry on top? When I add a new row in data, its getting last order in db. But in datagrivew I want to show last is first. How can i do that?

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    For this u need to change the procedure to bind the Datagridview
    In stored procedure you need to add order by clause with primary key.

    Like :      SELECT  EmpName,Age,Salary
                  from Emp
                  WHERE Salary > 12000
                  Order By EmpId              // EmpId   is the Primary key

    enjoy....

    Arun sharma
    0