Help on BindingSource Control

Posted on 2007-10-10
Last Modified: 2013-11-26
Hi All,
Thanks for clicking.

Historical we have upgraded our VB6 program to VB.NET using the upgrade wizard.

If VB6 data bindings was classic ADO, the VB.NET converts this to it's own Interop classic ADO control.

Functionally this works fine! However, it won't be supported forever, and we are concerned with how much speed were sacrificing, especially over a network.

We have developed a small application using the BindingSource control, and we can navigate between records easily

My question is this.

Is this control an adequate data control to use on a VB.NET VS2005 application, thinking about it from a speed point fo view, and especially over a network, before we decide to convert over our 150+ forms in our main application??

Also as a cheeky added bonus, if anybody has any idea how much speed we are losing by using classic ADO in a VS2005 environment, it'd be great if you could share with me.

Thanks so much
Question by:LKearney
    LVL 16

    Accepted Solution

    In terms of the .NET framework, the way we access our data has also changed. Pretty much everything in .NET uses XML as its underlying data structure, and even records from database are represented internally as well formed XML, which is then converted to the data type required by the client application.

    Since "classic" ASP's humble beginnings, ADO data access classes and methods have been re-written. When Microsoft decided to embark on its multi billion dollar .NET adventure, they also built a new version of ActiveX Data Objects (ADO) called ADO.NET.

    there is a really good article for comparing ADO and ADO.NET
    LVL 27

    Assisted Solution

    You know, I think the amount of time it takes to use a BindingSource is VERY insignificant.  Using a
    BindingSource will not incure a big enough performance hit to be noticeable.  I've included some code
    below for a performance test that demonstrates loading 10,000 records into a DataTable, and then
    setting the DataSource for a DataGridView using a BindingSource, and not using a BindingSource.

    Another thing to think about, is the amount of records that you are going to have in memory.  Honestly,
    having over 1000 records in memory isn't very good, performance wise.  You'll find that searching,
    filtering, enumerating, etc. will be slower with the more records you have in memory.  A better approach
    is to do your filtering with your database when you retrieve your records, and have as few records
    in your DataTable as possible.

    'Performance test code:
        'Just have a DataGridView on your form named "DataGridView1"
        Public Sub DataLoadPerformanceTest()

            'Load the data into a DataTable
            Dim dt As DataTable = Create2ColumnTable()

            Dim sw As New Stopwatch()

            'Use the Stopwatch to time how long it takes using a BindingSource
            Dim bs As New BindingSource()
            bs.DataSource = dt
            Me.DataGridView1.DataSource = bs

            'Load the data into a DataTable
            Dim dt2 As DataTable = Create2ColumnTable()

            'Use the Stopwatch to time how long it takes using a DataTable
            Me.DataGridView1.DataSource = dt2

        End Sub

        'Creates a DataTable with 10,000 records in it.
        Public Function Create2ColumnTable() As DataTable

            'Create a new datatable and set table name
            Dim dt As New DataTable("MyItems")

            'Add 2 columns to the table,
            '    setting the datatype of the id column to Int16
            'dt.Columns("ID").DataType = GetType(System.Int16)

            'Loop and add rows to table
            For i As Int16 = 1 To 10000
                dt.Rows.Add(i, "This is a test item with the number:  " & i.ToString)

            'Return the table
            Return dt

        End Function


    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    In my previous two articles we discussed Binary Serialization ( and XML Serialization ( In this article we will try to know more about SOAP (Simple Object Acces…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    This video discusses moving either the default database or any database to a new volume.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    754 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

    22 Experts available now in Live!

    Get 1:1 Help Now