如何从表格中的数据库到文本框中获取一些数据。 [英] How to fetch some of the data from databse to textbox in a form.

查看:82
本文介绍了如何从表格中的数据库到文本框中获取一些数据。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一张表格。有一个roll.no文本框,我希望当我输入一个卷号。 ,如果存在于数据库的表中,那么rollno会将相应的值(例如name,add等)以相同的形式带到文本框中。

希望我的查询清楚。

plz尽快回复。谢谢......

解决方案

你知道如何使用ADO.NET连接数据库吗? blockquote>


您是否知道如何使用ADO.NET连接数据库?



是的我知道连接步骤。我正在使用sqlserver.my查询是如何将数据从数据库中获取到表单中的文本框。我知道如何显示从数据库到gridveiw的数据,但我不知道如何从数据库显示到文本框中。



i hav a form。有一个roll.no文本框,我希望当我输入一个卷号。 ,如果存在于数据库的表中,那么rollno会将相应的值(例如name,add等)以相同的形式带到文本框中。

希望我的查询清楚。

plz尽快回复。谢谢......



然后只需根据输入的rollno编写一个过滤器,然后运行触发适当事件时的数据库。

如果你仍然遇到问题,请发布你的代码。


i hav a form. there is a roll.no textbox,i want that when i enter a roll no. ,that rollno if exist in a table in the database then it bring its corresponding values like name,add,etc to the textbox in the same form.
hope my query is clear.
plz reply as soon as possible.thanks......

解决方案

Do you know how to connect to a database using ADO.NET?


Do you know how to connect to a database using ADO.NET?

yes i know the connectivity steps.i am using sqlserver.my query is how to get the data from database to the textbox in a form.i know how to display the data from database to gridveiw but i dont know how to display it into textbox from database.


i hav a form. there is a roll.no textbox,i want that when i enter a roll no. ,that rollno if exist in a table in the database then it bring its corresponding values like name,add,etc to the textbox in the same form.
hope my query is clear.
plz reply as soon as possible.thanks......

Then just write a select that filters according to the entered rollno and run that against the database when an appropriate event is fired.
Post your code if you still get problems with it.


这篇关于如何从表格中的数据库到文本框中获取一些数据。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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