如何获取特定的行ID [英] how to get a particular row id

查看:65
本文介绍了如何获取特定的行ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

在我的aspx页面中,用户正在创建一个请求,并且在创建请求时,在databse中会自动生成一个request_id..我想检索特定的request_id并将其显示在同一网页上.
请帮助... 它的紧迫...

hi everyone,

in my aspx page user is creating a request and when the request is created a request_id is generated automatically in databse..i want to retreive tht particular request_id and display it on the same web page..

plz help...its urgent...

推荐答案

有几种方法可以做到,但是只有一种可靠的方法:搜索您刚刚输入的信息的数据库.

您可以通过几种方法来检索上一次创建的ID,但是在多用户系统中,使用它们并不安全,因为有时,另一个用户会在您之后以及获取信息之前进入.间歇性错误很难找到...

如果您确实需要从自动生成的数据库字段中获取ID,那么我建议您首先不要使用自动生成的数据库字段.改用GUID,然后生成它,并确切知道要查看的记录.
There are a few ways to do it, but only one reliable one: search the database for the info you have just entered.

There are a few ways you can retrieve the last created ID, but in a multi-user system they are not safe to use, as sometimes, a different user will get in just after you, and before you get the info. Intermittent bugs are no fun to find...

If you really need to get the ID from an automatically generated database field, then I would recommend not using automatically generated database fields in the first place. Use a GUID instead, as you then generate it and know exactly which record you are looking at.


这篇关于如何获取特定的行ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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