This will return all movie IDs and titles from movie_table ordered by id.
Code:
SELECT [movie_ID], [movie_Title] FROM [Movie_Table] ORDER BY [MOVIE_ID]
if you need to get only one record, you should provide WHERE clause to your query:
Code:
SELECT [movie_ID], [movie_Title] FROM [Movie_Table] ORDER BY [MOVIE_ID] WHERE your condition here
i.e.
Code:
SELECT [movie_ID], [movie_Title] FROM [Movie_Table] ORDER BY [MOVIE_ID] WHERE movie_ID=17;
or
Code:
SELECT [movie_ID], [movie_Title] FROM [Movie_Table] ORDER BY [MOVIE_ID] WHERE movie_Title='Batman returns';
This section doen't make any sense to me.
I'll comment it, perhaps you'll get more sense out of it
vb Code:
' lrd(1) would be movie_Title so reader will have the movie title from the current record
Dim reader As String = lrd(1).ToString' i.e. "Armageddon"
Dim arrLoad As New ArrayList
arrLoad.Add(lrd(1).ToString)' You add this title to the array list (by the way, ArrayList is Obsolete, use List or Dictionary
' You iterate through each textbox on the Panel
' And you do it with each record in the Movie_Table, i.e. if you have 500 movie titles there
' then the following cycle will repeat 500 times:
For Each cCtrl As Control In Panel1.Controls
If TypeOf cCtrl Is TextBox Then
Dim txtBox As New TextBox ' dont use New here, you don't need it.
txtBox = cCtrl
txtBox.Text = arrLoad.Item(i) ' Each textbox on the panel will have the same value.
End If
Next
On the second look, I gather that you want to create a textbox for an each movie title. What will you do if you have 1,000 movies, 10,000?
I suggest doing the same thing with DataGridView. It will be more consistend and easier for you.