如何在文本框中显示数据库中的值?

发布于 2025-01-07 04:20:37 字数 1046 浏览 2 评论 0原文

您好,我有像这样的数据库

Users Table

     user_id |   username  |  branch_id(foreignkey)|  Approved_id(foreignkey)
  -------------------------------------------------------------------------------
    1          jprescott         2                          1
    2          lpausch           1                          3

Branch Table


Branch_id    BranchName        
1                abc                    
2               asjdv                 
3               ydgfs             

Approvetable


     ApproveId  ApprovedBy
          1         Anil
           2         ghouse
           3         raghu

现在我有 3 个文本框,当用户 1 登录时,我如何在文本框中输入这些字段,

          txtusername.text=username from table 1;
          txtapprovedname=approved by from table 2;
          txtbranchname=branchname from table 3;

它应该检查分支 id 并转到分支表并显示分支名称,然后检查批准并转到批准表并在文本框中显示批准名称......

现在如何为此编写一条选择语句任何人都可以帮助我..............

Hi i have database like this

Users Table

     user_id |   username  |  branch_id(foreignkey)|  Approved_id(foreignkey)
  -------------------------------------------------------------------------------
    1          jprescott         2                          1
    2          lpausch           1                          3

Branch Table


Branch_id    BranchName        
1                abc                    
2               asjdv                 
3               ydgfs             

Approvetable


     ApproveId  ApprovedBy
          1         Anil
           2         ghouse
           3         raghu

now i have 3 textboxes,how do i these fields in the textboxes

          txtusername.text=username from table 1;
          txtapprovedname=approved by from table 2;
          txtbranchname=branchname from table 3;

when user 1 logins it should check the branch id and go to the branch table and disply the branch name,and check the approveid and go to the approvedtable and displya the approvedname in textboxes.....

now how to write a select statement for this can any one help me plz...........

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

め七分饶幸 2025-01-14 04:20:37
select UsersTable.username, ApproveTable.ApprovedBy, Branchtable.BranchName
from UsersTable, Branchtable, Approvetable
where UsersTable.branch_id = BranchTable.branch_id
AND UsersTable.approved_id = ApproveTable.ApproveId
AND UsersTable.User_id = %CurrentUserID%
select UsersTable.username, ApproveTable.ApprovedBy, Branchtable.BranchName
from UsersTable, Branchtable, Approvetable
where UsersTable.branch_id = BranchTable.branch_id
AND UsersTable.approved_id = ApproveTable.ApproveId
AND UsersTable.User_id = %CurrentUserID%
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文