I'm trying to display some data from a MySQL database on a form using a DataRepeater control. I have had a looked at a few articles on this and they suggest that I need to create a datasource and bind it to the datarepeater control. This link explains how to do this.
However, I would like to bind the DataRepeater and its contents manually in vb code rather than using the wizard. The link above gives some ideas of how to do this in code (near the bottom) but it does not explain how to bind controls within the the DataRepeater to the data and display the results.
I have attached a code snippet of the code behind the form as it stands. Basically when the form load, it will query a database and then print the data in the console window. This part is working fine. What I would like to do now, is to add a DataRepeater control to the form and display the results in the DataRepeater rather than the console window but I would like to do this using vb code rather than using drag and drop.
Could some please give me some sample code on how this can be achived (baring in mind that I am a beginner in vb.net)?
Many thanks for your help.
Public Class frmMovieList
Private Sub frmMovieList_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If frmMain.titleSearch = True Then
'strTitle is a string variable
Dim queryString As String = "SELECT * FROM movies where title like '%" & frmMain.strTitle & "%' OR title like '" & frmMain.strTitle & "%'"
Dim myCommand As New MySqlCommand(queryString, frmMain.myConnection)
Dim myDataReader As MySqlDataReader
myDataReader = myCommand.ExecuteReader()
MsgBox("nothing to do")