开发者

how to display the records from gridview which is latest record show on first row

I have small appl开发者_JS百科ication which uses a gridview. In that, when we insert the records into the database which is current that record show in first row of the gridview. Please tell me how?


if you have a primary key auto increment or an insert datetime in your table, you can query the database with a ORDER BY ID DESC or ORDER BY INSERTDATE DESC at the end of the select command.


Another way could be to use the BindingSource.Sort property. Enter the column name and "desc" if needed.

MSDN documentation of Sort property

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜