Hi everyone.

Since I'm new to WPF and Visual Studio 2010 I've been watching videos and reading articles to start creating my own applications, however, I always find most tutorial too complicated or incomplete. I watched a video How Do I: Create a Simple Data Entry Form in WPF from Video Training - WindowsClient.net and it was nice, I tried to make my own and it worked, text boxes bound to fields in database, I can browse through it using buttons(movetoFirst, Previous, Next, movetoLast).
However, the tutorial didn't show how to add a search function, could you guys help me with this?

I have a table StudentInfo(StudentID, FirstName, MiddleName, LastName), I want to search using the StudentID(the format of studentID is YYYY-#### ex. 2011-0001).
I'm sorry if my explanation doesn't make sense.

Here's the working part of the code:
Code:
Class MainWindow 
    Private StudentData As New enrollmentdatabaseDataSet
    Private taStudent As New enrollmentdatabaseDataSetTableAdapters.studentinfoTableAdapter
    Private taManager As New enrollmentdatabaseDataSetTableAdapters.TableAdapterManager
    Private View As CollectionView
    Private Sub MainWindow_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
        Me.taStudent.Fill(Me.StudentData.studentinfo)
        Me.taManager.studentinfoTableAdapter = taStudent
        Me.DataContext = Me.StudentData.studentinfo
        Me.View = CollectionViewSource.GetDefaultView(Me.StudentData.studentinfo)
    End Sub


    Private Sub btnFirst_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnFirst.Click
        Me.View.MoveCurrentToFirst()
    End Sub


    Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnPrevious.Click
        If Me.View.CurrentPosition > 0 Then
            Me.View.MoveCurrentToPrevious()
        End If
    End Sub


    Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnNext.Click
        If Me.View.CurrentPosition < Me.View.Count - 1 Then
            Me.View.MoveCurrentToNext()
        End If
    End Sub




    Private Sub btnLast_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnLast.Click
        Me.View.MoveCurrentToLast()
    End Sub

This is what I came up with for the search:
Code:
    Private Sub btnGo_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnGo.Click
        Me.taStudent.FillBy(Me.StudentData.studentinfo, txtSearch.Text) 'a custom query in table adapter: 
        Me.taManager.studentinfoTableAdapter = taStudent
        Me.View = CollectionViewSource.GetDefaultView(Me.StudentData.studentinfo)
        Me.View.MoveCurrentToNext()
    End Sub
It would show the searched student, however, after clicking, other buttons won't work anymore(I believe it's because I filled the taStudent using the new query).


Whew, I hope I made myself clear, thank you in advance.
-Leenej