使用会话更新表中的列 [英] using session updte a column in table

查看:55
本文介绍了使用会话更新表中的列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


这是我的问题,我的第一个页面是此用户名密码字段中的登录页面.如果用户以管理员身份登录到该页面,他将重定向到一个页面,在该页面中他可以执行所有管理员操作,例如创建用户和编辑用户,数据库表"createdby"列应由创建用户的特定管理员进行更新.管理员值通过会话从登录页面获取.


here is my question my first page is login page in this username password fields are there.if the user login in to the page as admin he redirects to a page where he can perform all admin operations such as creating user and editing him,in my database table ''createdby'' column should be updated by the particular admin who created the user.and the admin value i''m getting form the login page through session.

推荐答案

你好,

将用户ID存储到会话中,然后将该用户ID插入表的更新者"列中.
Hi,

Store the User Id into the session and insert that user id into the "Updated By" columns of the table.
"Session["UserID'] = txtUserId.Text;


AND


AND

string Query = "INSERT INTO YourTable (col1,...,UpdatedBy) VALUES(....,'" + Session["UserID"] + '")";



希望对您有所帮助.



hope it helps.


这篇关于使用会话更新表中的列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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