C#Web-App:如何从SQL表中检索数据? [英] C# Web-App: how to retreive data form SQL tables?

查看:69
本文介绍了C#Web-App:如何从SQL表中检索数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在C#网页表单中从组合框中选择值时从文本框中获取数据?

我使用两个表employee和worker table.i成功地使用来自SQL员工的数据填充组合框当我在组合框中单击员工的数据时,我无法在文本框中显示工人表中的相关数据。请帮帮我?

我知道如何在WINDOWS形式中做到这一点。 PLZ告诉我关于WEB FORMS。

How to get data from database in text box on selecting a value from combobox in C# web forms?
Im using two tables employee and worker table.i succeeded in populating combobox with data from SQL employee table.When I click employee?s data in combobox I cant display related data from worker table in textbox. plz help me?.
I KNOW HOW TO DO THIS IN WINDOWS FORMS . PLZ TELL ME ABOUT WEB FORMS.

推荐答案

你可以使用连接来获取worker的数据。
u could use joins in order to get the data of worker.



u可以使用连接来获取worker的数据。
u could use joins in order to get the data of worker.



我不要求SQl query.im询问文本框的代码。

我在文本框中显示数据有问题。

im not asking for the SQl query.im asking for the code for textbox.
im having problem with displaying data in textboxes.



如何在C#网络表单中从组合框中选择值时从文本框中获取数据?

我使用两个表employee和worker table.i成功地用来自SQL员工表的数据填充组合框。当我在组合框中单击员工的数据时,我无法在文本框中显示来自工作表的相关数据。请帮帮我?

我知道如何在WINDOWS形式中做到这一点。 PLZ告诉我关于网络形式的信息。
How to get data from database in text box on selecting a value from combobox in C# web forms?
Im using two tables employee and worker table.i succeeded in populating combobox with data from SQL employee table.When I click employee?s data in combobox I cant display related data from worker table in textbox. plz help me?.
I KNOW HOW TO DO THIS IN WINDOWS FORMS . PLZ TELL ME ABOUT WEB FORMS.



我建议您创建一个存储过程,为员工和员工返回数据。然后,您可以使用此信息填充数据集,并使用数据集中的数据填充组合框以及在文本框中显示相关数据。您可以使用组合框的SelectedIndexChanged事件自动使用您想要的数据填充文本框。


Nathan

I would recommend that you create a stored procedure that returns data for an employee and a worker. You can then fill a dataset with this information and use the data from the dataset to fill the combobox as well as display related data in your textbox. You can use the SelectedIndexChanged event of your combobox to automatically populate the textbox with the data that you want.

Nathan


这篇关于C#Web-App:如何从SQL表中检索数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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