Click here to Skip to main content
16,004,761 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi sir,
i have one data grid view with some of data iam enternig some new data using insert command i want get that data first row in data grid view (i.e) Last in First out
Posted
Updated 2-Jul-12 19:30pm
v2

set primarykey for Table andthen get records in orderby Desc is FIFO method for example
SQL
select * from table  order by ID  desc
 
Share this answer
 
Comments
Lokesh Zende 3-Jul-12 4:25am    
My 5..
Assuming you have a primary key that is incremented everytime you insert a record, you can simply fetch all records sorting by this key in descending order.

This will give you the last record first.
 
Share this answer
 
If there is a primary key for the table you are using and it is integer then, in select command write query to fetch the data in descending order by that primary key.
Else add one date time to the table and in select command write query to fetch the data in descending order by that primary key
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900