填充datagridview问题. [英] populating datagridview issue..

查看:92
本文介绍了填充datagridview问题.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有两个文本框....CityCode,CityName

数据是..CityCode(A001,A002,A003 ... B001,B002,C001,C002 ...)这样的..

我想要的是,当我在citycode文本框中输入"A"时,所有以"A"开头的城市代码都应出现在弹出式窗口中(DataGridview)...请帮助我..

Hi,
i have two text boxes....CityCode,CityName

Data is..CityCode(A001,A002,A003...B001,B002,C001,C002...) like that..

what i want is ,when i type ''A'' in citycode textbox,all the city codes that starts with ''A'' should come in pop up window(DataGridview)...please help me..

推荐答案


在Textbox_Textchanged事件中添加此查询并填充DataGridView-
声明一个数据集对象

Hi,
Add this query in Textbox_Textchanged Event and populate the DataGridView-
Declare one Dataset Object

Dim da as OleDbDataAdapter("Select * from Table where CityCode like ''"& TextBox1.Text &"%''", Connection)

da.Fill(ds,"TableName")
DataGridView.DataSource=ds.Tables(0)




谢谢




Thanks


使用此Textbox_Textchanged事件,以便当您继续键入时将显示您的内容
use this Textbox_Textchanged Event so that as u go on typing u will get displayd


这篇关于填充datagridview问题.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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