用于显示数据库中最新添加的代码 [英] Code for displaying the latest addition in database

查看:48
本文介绍了用于显示数据库中最新添加的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的网站主页上显示数据库中添加的最新信息,因为任何人都可以帮助我获取代码,或者如何在asp.net数据库MSSql 2005中做到这一点,

我可以使用gridview

I want to show the latest information add in the database on the main page of my website, ca any one help me for the code or how can i do this in asp.net database MSSql 2005,

Can i display this using gridview

推荐答案

显示此信息吗?您是否在表格上创建/更新了日期?如果有的话,可以使用这些命令对查询进行排序.另外,您可以按标识列进行排序,但这只会显示已插入项目的位置-不会显示已更新项目的位置.
Do you have a date created/updated on the tables? If you have, you can use these to order your query. Alternatively, you could order by the identity column, but this will only show where items have been inserted - it won''t display where items have been updated.


您尚未给出我们有足够的信息来准确地回答问题,但是如果您的表有一个Identity列,则只需执行以下操作:

You haven''t given us enough info to answer the question accurately, but if your table has a identity column, you can simply do this :

select top 1 * from table order by identitycolumn desc


采用一种方法来静默检查数据库中的更改,并且是否有任何更改反映了页面中的更改.为此使用AJAX更新面板.

谢谢
Nitesh Meshram
Make a method that silently checks the changes in data base and if there is any changes reflect changes in the page..use AJAX Update Panel for this.

Thanx
Nitesh Meshram


这篇关于用于显示数据库中最新添加的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆