如何在文本框中显示数据 [英] how toshow the the data in text box

查看:108
本文介绍了如何在文本框中显示数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个下拉列表和一个文本框。

我有一个表分支。

我通过配置database.so分支在下拉列表中选择数据库没有进入下拉列表清单。

我在下拉列表中选择文本,我必须在文本框中只显示所选分支的分支名称。

然后如何显示?

plz帮帮我。

I have one dropdown list and one textbox.
I have one table branch.
I select database in dropdownlist by configuring database.so branch no come in drop down list.
I select the text in dropdown list and i have to show only branch name of selected branch no in text box.
then how to show?
plz help me.

推荐答案

Amu,



我希望你自己做。下面是算法。一步一步阅读。做的事情会产生你想要的东西。

我希望你也使用其他语言的框架(VB.net或C#ETC)



注意:请使用您用于FW的语言在以下步骤中替换框架语言{Your FW Lang}。



算法

1)用您的语言创建一个公共方法来连接数据库(Connection对象)

2)打开WWW.GOOGLE.COM并搜索如何连接数据库{Your FW Lang}

3)在上面的步骤中找到的代码中修改了连接字符串,以便从使用选择中获取数据库名称

4)调用此方法单击数据库选择下拉框事件

5)它将创建将具有数据库连接的连接对象

6)创建一个方法来填充分支,不接受源代码数据库表。使用上面步骤中创建的连接对象

7)调用此方法以及步骤4

8)C使用将运行查询以从分支号查找分支名称再创建一个方法。使用在步骤#3中创建的连接对象

9)在分支无选择下拉框的单击事件上调用此方法,并将结果显示在文本框上



希望这会有所帮助,如果是,然后投票并接受答案,否则回复你的疑问

--RD
Amu ,

I want you to do it yourself . Below is algorithm . Read it step by step . Do the thing and will result into what you want.
I hope you are using some other language also for framework(VB.net Or C# ETC)

Note : Please replace framework language "{Your FW Lang}" in below steps with language you are using for FW.

Algorithm
1) Create one public method in your language to connect the database (Connection object)
2) Open "WWW.GOOGLE.COM" and search for "How to connect database in "{Your FW Lang}"
3) Modified connection string in the code you have found in above step so that it will take database name from use selection
4) Call this method on click event of "Database Selection Drop Down Box"
5) It will create connection object which will have database connection
6) Create one method to populate branch no taking source as database table. Use connection object created in above step
7) Call this method along with step no 4
8) Create one more method with will run query to find branch name from branch no. Use connection object created in step#3
9) Call this method on click event of "Branch No Selection Drop Down Box" and display result on to text box

Hope this will help if yes then vote and accept the answer otherwise revert back with your queries
--RD


我假设你以前将数据加载到dropdownlist soo下一步是选择数据显示在文本框中,该步骤是:



1.

双击你的下拉控件并写入以下代码:



2.

protected void DropDownList1_SelectedIndexChanged(object sender,EventArgs e)

{

this.TextBox1.Text = this.DropDownList1.SelectedItem.Text;

}



我希望这会对你有帮助......
I assume you previously loaded data into dropdownlist soo next step is selected data to be shown in textbox, that step is:

1.
double click on your dropdown control and writte the following code:

2.
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
this.TextBox1.Text = this.DropDownList1.SelectedItem.Text;
}

I hope this will help you...


这篇关于如何在文本框中显示数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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