通过使用组合框检索TextBox中的数据 [英] Retrieve Data in TextBox from using Combo box

查看:75
本文介绍了通过使用组合框检索TextBox中的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我也有employee_id 1000,1001,1002,1003,1004 ...我的其他字段同样是employee_name,employee_age,employee_mobile...

我现在需要的是在组合框中输入一个employee_id.如果我在下面的文本框中的组合框中选择了employee_id,我想显示其他字段,例如,employee_name,employee_age,employee_mobile ..

我应该怎么做?

I have employee_id 1000,1001,1002,1003,1004... likewise. And my other fields are employee_name,employee_age,employee_mobile likewise.,.

what i need now is i get a employee_id in combo box. if i select the employee_id in combo box in the below text boxes i want to display the other fields like employee_name,employee_age,employee_mobile..

how should i do ?

推荐答案

您当然可以查询数据库并选择与所选员工ID匹配的记录.您遇到什么困难?可以使用的资源无数,涵盖了ADO.NET.
You, of course, query the database and select the records matching the selected employee id. What part are you having difficulty with? There innumerable resources available that cover ADO.NET.


您可以使用"SelectedIdexChanged"从DDL访问选定的项目.
You can access the selected item from DDL using "SelectedIdexChanged".


您可以轻松地做到这一点.

1.使用数据库中的"employee_id"搜索数据.您可以使用ComboBox/DropDownList的SelectedValue属性
2.如果找到数据,则在文本框中显示数据
you can do it easily

1. search data using " employee_id " from DataBase . you can use SelectedValue property of your ComboBox / DropDownList
2. If data found then show data in the Textbox


这篇关于通过使用组合框检索TextBox中的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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