如何在文本框中显示单个SQL数据库条目? [英] how to display a single sql database entry in a text box?

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

问题描述

我有3个文本框..文本框中的Textbox1,Textbox2,Textbox3和3个字段DocID,DocName,DocType



我想知道如何在Textbox1中显示DocID的条目..任何人都可以帮忙吗?谢谢!



我正在使用MySQL 2005作为服务器数据库和VB.net 2010.

解决方案

1。建立数据库连接

2.在Textbox1更改事件上,写下代码以查询具有给定ID(DocID?)的数据库,用于字段DocName,DocType ...您可以使用sqlreader ..

3.读取结果的sqlreader对象并显示在文本框中(TextBox2和TextBox3)


Hi, I have 3 textbox.. Textbox1, Textbox2, Textbox3, and 3 fields in a table DocID, DocName, DocType

I want to know how to display the entry of DocID in Textbox1.. can anyone help? thanks!

I''m using MySQL 2005 as a server data base and VB.net 2010.

解决方案

1. Establish a database connection
2. On Textbox1 change event, write you code to query the database with the given id (DocID ?) for the fields DocName,DocType...you can use sqlreader..
3. Read the sqlreader object for the result and display in the text boxes (TextBox2 & TextBox3)


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

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