Hi guys....longtime:) Am working on a movie rental system in VB.NET, but there's a problem. I want a situation whereby the user will have the privilege to search for desired records by typing a search string, then hitting the search button. The results should be shown on a datagridview. Here's my code:
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
Dim MovieName As String
If txtMovieNamesearch.Text = "" Then
MessageBox.Show("You must enter the name of the movie you want to search!", "I-Spot Movies", MessageBoxButtons.OK, MessageBoxIcon.Error)
txtMovieNamesearch.Focus()
Else
MovieName = "select * from Movies WHERE (Movie Name='" & txtMovieNamesearch.Text & "')"
MoviesTableAdapter.FillByMovieName(_I_Spot_MoviesDataSet.Movies)
End If
End Sub
When i type a search string in the textbox and then i hit the search button, all the records disappear :( please help!!