Displaying data in a DataRepeater Control in

Posted on 2009-02-13
Last Modified: 2013-11-26

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

Many thanks for your help.


'Test Form

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()

            While myDataReader.Read


            End While




            MsgBox("nothing to do")

        End If

    End Sub

End Class

Open in new window

Question by:shorak
    LVL 69

    Accepted Solution

    LVL 11

    Author Comment

    Hi.. thanks for the link.. I followed it through and got my datarepeater working. I have added two textboxes to my datarepeater and have formatted them so that they are read only and dont have any borders. In the datarepeater display, I am getting a black line in between each row as well as a 'record select?' type button to the left. I have managed to remove the button from the display but am having trouble removing the line between each row.. do you know if it can be done?

    Thanks again for your help.

    LVL 69

    Expert Comment

    by:Éric Moreau
    I really don't think it can be done. See this question that has been asked to the team responsible for this component:
    LVL 11

    Author Closing Comment

    Thanks for your help.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    In my previous article ( we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
    This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now