vb.net 2003 - populating with "like"

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bill Brinkworth

    #1

    vb.net 2003 - populating with "like"

    I want the user to type in part of a word, and I want to return all words
    from an Access word table that contains specified letters. If they were to
    type "fe??", it should return all words in the dictionary that are 4 letters
    and begin with "fe" into a listbox. I am having difficulting searching for
    all words and taking all those words and populating a listbox. Can you help?
    Here's what I have:

    CLASS -
    Public Property word() As String
    Get
    Return m_Word
    End Get
    Set(ByVal Value As String)
    m_Word = Value
    End Set
    End Property

    Public Sub GetWord(ByVal Word As String)
    con.Open()
    cmdSelect.Param eters("@Word"). Value = Word
    Dim dr As OleDb.OleDbData Reader
    dr = cmdSelect.Execu teReader
    While dr.Read
    m_Word = dr("Word")
    m_length = dr("Length")
    End While

    dr.Close()
    con.Close()
    End Sub

    Private Sub Find2_Click(ByV al sender As System.Object, ByVal e As
    System.EventArg s) Handles Find2.Click

    Dim finished As Boolean = False, line As String

    'clean out the listbox first
    Display.Items.C lear()

    m_foundword = New FindWord

    ' While Not finished
    m_foundword.Get Word(WordFind.T ext)
    'Do While WordFind.Text = m_foundword.wor d ' the loop didn't work so
    i
    ''comented it
    If WordFind.Text = m_foundword.wor d Then ' this will pull up one entry
    ' If WordFind.Text like m_foundword.wor d Then 'doesn't work

    m_foundword.Get Word(WordFind.T ext)
    Display.Items.A dd(m_foundword. word)

    End If
    'i = i + 1
    'Loop


Working...