根据用户ID更新两个具有相同值的不同表中的两列 - ASP.NET [英] Updating two columns in two different tables with same value depending on user id - ASP.NET

查看:86
本文介绍了根据用户ID更新两个具有相同值的不同表中的两列 - ASP.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好





我想问一个问题



我有两个ASP.Net页面。



第1页是员工管理页面,第2页是用户管理页面



员工页面连接到员工表用户页面连接到用户表



例如我们有用户名A,此用户将在两个表中使用不同的信息,除了移动号码身份证号码



所以,当(员工页面的管理员)更改 A 的手机号码时,应该在上更改用户表



如果(管理员用户页面)更改了A的手机号码,则应在员工表上更改。



我希望我的想法很清楚,谢谢

Hi everybody


I want ask a question

I have two ASP.Net pages.

page 1 is Employees admin page and page 2 is Users admin page.

Employees page connect to Employee table and User page connect to User table.

for example we have user his name A, this user will be in both tables with different info except mobile number and id number.

so, when (the admin of employee page) change the mobile number of A , it should be changed too on the User table.

And if the (admin of user page) change the mobile number of A it should be changed too on the Employee table.

I hope my idea is clear, thanks

推荐答案

@new_value和@id是你传递给的参数存储过程/处理数据库访问的DAL级别/代码。查询是基于id的简单更新。



@new_value and @id are parameters you pass to the stored procedure / your DAL level / code which handles your database access. The query is simple update based on id.

UPDATE user_table
    SET mobile_number = @new_value
WHERE
    id = @id





如果这有帮助,请花时间接受解决方案,以便其他人可以找到它。谢谢。



If this helps, please take time to accept the solution so that others may find it. Thank you.


这篇关于根据用户ID更新两个具有相同值的不同表中的两列 - ASP.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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