Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 596279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:09:18+00:00 2026-05-13T16:09:18+00:00

I am looking for a vb.net example of how to bind a dataset/datatable to

  • 0

I am looking for a vb.net example of how to bind a dataset/datatable to data repeater and have the data elements bound to the columns of the dataset/datatable?
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T16:09:18+00:00Added an answer on May 13, 2026 at 4:09 pm

    At first I thought you wanted a web repeater, but from your comments I realized you meant Microsoft.VisualBasic.PowerPacks.DataRepeater.

    I need some more info from you to give the most helpful sample code (see below).

    The basic steps of using a DataRepeater are:
    1) Install the Visual Basic Power Packs 3 Link
    2) Open a VB.net Winforms project and drag a DataRepeater to your form
    3) Add a new Dataset to your project via Add->New Item menu
    4) In the design window, set up columns as desired
    5) Open the Data Sources window from Data->ShowDataSources menu
    6) With your form in design mode, go to the Dataset in the Data Sources window and use the dropdown box next to the table name to select “Details”
    7) Drag the table to top section of the DataRepeater control (on your form). The table fields should now be listed on your DataRepeater. You can move them around.
    8) At runtime, you can load the Datset and the DataRepeater will automatically reflect the data changes. No .Databind is required
    ex.

    me.DataSet1.Tables(0).Columns.Add(New String() {"John", "Doe", "Accountant"}  
    

    or

    myDataAdapter.Fill(me.DataSet1.Tables(0)) 
    

    Do you get tripped up on any of those steps?


    Edit:

    From what I have seen, it looks like DataRepeater is meant to be used in situations were you add/map the datatable to the DataRepeater at design-time. Then all you have to do is fill the datatable at run-time and the DataReader shows the data automatically.

    If you really want to add the table/controls to the DataRepeater at run time, here’s an example I coded for you. It assumes a form named Form3 with a DataRepeater named DataRepeater1 and a button named Button1…

    Public Class Form3
    
        ''Set up demo DataSet/DataTable
        Const FRUIT_COL As String = "Fruit"
        Const COLOR_COL As String = "Color"
        MyDataSet = New DataSet
        MyDataSet.Tables.Add("MyTable")
        With MyDataSet.Tables(0)
            .Columns.Add(FRUIT_COL, GetType(System.String))
            .Columns.Add(COLOR_COL, GetType(System.String))
        End With
    
        ''Populate the DataTable with sample data. You would be loading from SQL
        With MyDataSet.Tables(0)
            .Rows.Add(New String() {"Apple", "Red"})
            .Rows.Add(New String() {"Orange", "Orange"})
            .Rows.Add(New String() {"Banana", "Yellow"})
        End With
    
        ''These objects would normally be created automatically if you added DataTable to DataRepeater at design-time
        FruitLabel = New Label
        FruitTextBox = New TextBox
        ColorLabel = New Label
        ColorTextBox = New TextBox
        With FruitLabel
            .AutoSize = True
            .Location = New Point(10, 20)
            .Name = "FruitLabel"
            .Text = FRUIT_COL
        End With
        With ColorLabel
            .AutoSize = True
            .Location = New Point(10, 60)
            .Name = "FruitLabel"
            .Text = FRUIT_COL
        End With
        With FruitTextBox
            .Location = New Point(50, 20)
            .Size = New Size(60, 15)
            .DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.MyDataSet.Tables(0), FRUIT_COL, True))
        End With
        With ColorTextBox
            .Size = New Size(60, 15)
            .Location = New Point(50, 60)
            .DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.MyDataSet.Tables(0), COLOR_COL, True))
        End With
    
        ''Add the controls that will be displayed for each row in DataTable
        With DataRepeater1
            .ItemTemplate.Controls.Add(FruitLabel)
            .ItemTemplate.Controls.Add(FruitTextBox)
            .ItemTemplate.Controls.Add(ColorLabel)
            .ItemTemplate.Controls.Add(ColorTextBox)
        End With
    
        ''Run-time population of DataRepeater from your DataTable
        DataRepeater1.DataSource = MyDataSet
        DataRepeater1.DataMember = MyDataSet.Tables(0).TableName
    
    End Sub
    
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        'Example of how you can add additional rows with form elements
        With MyDataSet.Tables(0)
            .Rows.Add(New String() {"Grapes", "Green"})
        End With
    End Sub
    End Class
    

    Now that you have seen the code, I hope you don’t use it 🙂
    I suggest you either set up your DataSet structure at design-time or use a different control to display your data.

    Here’s a link that has lots of information about the typical way to use DataRepeater:
    Link

    Final Edit

    The user’s last bug was a case-sensitivity issue. The string “Text” in the following line of code must be capitalized to match the control’s property name. I recommend creating a const for “Test” to avoid this typo.

    [ControlName].DataBindings.Add(New System.Windows.Forms.Binding("Text", [DataTable], [Column Name], True))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 293k
  • Answers 294k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The documentation for the Descendants property says: Returns a collection… May 13, 2026 at 6:33 pm
  • Editorial Team
    Editorial Team added an answer import re text="""{{rdex|001|001|Bulbasaur|2|Grass|Poison}}""" re.findall("\{\{[^|]+\|(\d+)\|\d+\|([^|]+)",text) [('001', 'Bulbasaur')] May 13, 2026 at 6:33 pm
  • Editorial Team
    Editorial Team added an answer Yes, you can remove it from the output. The XML… May 13, 2026 at 6:33 pm

Related Questions

I am looking for an example of how to do the following in VB.net
I have a small database that I need help designing. I have a VB.NET
How can I play a sound based on waveform data that my .NET program
How can I use WIA and Twain in C#? The TWIAIN/C# example found at
I'm a .NET web developer, who's bought a Mac, and is interested in doing

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.