Dear Sir
I have access data table and vb . project .access data table include ID ,word and description Colum v b project include three text box and one list box. If I search any word in text box through word Colum .I want show description Colum next text box how can do it.
Please help me.
Thank you
Wansa
Imports System.Data
Imports System.Data.OleDb
Public Class Form1
WithEvents bs As New BindingSource
Dim tblcontactconnection As New OleDb.OleDbConnection
Dim provider As String
Dim dbtblcontact As String
Dim dstblcontact As New DataSet
Dim datblcontact As OleDb.OleDbDataAdapter
Dim SqlQuery As String
Dim NumberofRows As Integer
Dim NumberRow As Integer = 0
Dim dt As DataTable
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
provider = "Provider=Microsoft.Ace.Oledb.12.0;"
dbtblcontact = "Data Source=C:\Users\Home\Desktop\english.accdb"
tblcontactconnection.ConnectionString = provider & dbtblcontact
tblcontactconnection.Open()
'access data table name is game
SqlQuery = "SELECT * FROM wordlist"
datblcontact = New OleDb.OleDbDataAdapter(SqlQuery, tblcontactconnection)
datblcontact.Fill(dstblcontact, "wordlist")
tblcontactconnection.Close()
Me.bs.DataSource = dstblcontact.Tables("wordlist")
'access data table searching coloum is word
Me.ListBox1.DisplayMember = "word"
Me.ListBox1.DataSource = Me.bs
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Dim dt As DataTable = CType(bs.DataSource, DataTable)
dt.DefaultView.RowFilter = String.Format("word like '{0}%'", TextBox1.Text)
If dt.DefaultView.Count > 0 Then
For Each item As DataRowView In dt.DefaultView
TextBox2=
Next
End If
End Sub
End Class