最后插入guid并在页面加载时将guid存储在文本框中 [英] get last inserted guid and store that guid in textbox at the time of page loading

查看:93
本文介绍了最后插入guid并在页面加载时将guid存储在文本框中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在表格中有一个guid列,基于我想要检索最后插入行的guid。并在页面加载时存储该信息...我的意思是在用户登录后,他能够看到他所有最后插入的值...





问候

sreekanth

Hi,

I have a guid column in table based on that guid i wants to retrieve last inserted row. and store that information at the time of page load...i mean after login by user he can able to see all the last inserted values by him..


Regards
sreekanth

推荐答案

请阅读我对该问题的评论。我不确定最后插入行是什么意思,特别是在这个上下文中:最后一次插入值(用户)



您所需要的只是使用存储过程 [ ^ ](SP)比从后面的代码调用它。



要获取用户插入的所有数据:

Please, read my comment to the question. I'm not sure what you mean by "last inserted row" especially in this context: "last inserted values by (user)".

All what you need is to use stored procedure[^] (SP) than call it from code behind.

To get all data inserted by user:
CREATE PROCEDURE GetGUIDByUser
    @userid INT
AS
BEGIN
    SELECT GuidKey 
    FROM TableName
    WHERE userid = @userid
END





要获取最后插入的值,请参阅: @@ IDENTITY [ ^ ]并在SP中使用它来插入数据。



看看这里:

演练:使用GridView Web服务器控件中的存储过程显示数据 [ ^ ]

使用存储过程修改数据 [ ^ ]

如何:执行返回行的存储过程 [ ^ ]



To get last inserted value, see: @@IDENTITY[^] and use it in SP in which data are inserted.

Have a look here:
Walkthrough: Displaying Data Using a Stored Procedure in the GridView Web Server Control[^]
Modifying Data with Stored Procedures[^]
How to: Execute a Stored Procedure that Returns Rows[^]


这篇关于最后插入guid并在页面加载时将guid存储在文本框中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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