Problems with datagrid

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
Posts: 2
Joined: Sun 15 Jan 2006 12:32

Problems with datagrid

Post by abraiante » Sun 15 Jan 2006 12:41


I'm using mysqldirect 2.80 with visual 2003 edition.

i'm using this code to view the result of a query in a datagrid component, as one person told in other thread of this forum, exactly in ... t=datagrid.

Code: Select all

Private Sub btngenerar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btngenerar.Click
        Dim myDataTable As CoreLab.MySql.MySqlDataTable = New CoreLab.MySql.MySqlDataTable("SELECT * FROM operadoras", "User Id=***;password=***;Host=***;Database=***")
            DataGrid1.DataSource = myDataTable
            myDataTable.Active = True
            myDataTable.Active = False
        End Try

    End Sub
In datagrid i only view the name of columns, but there isn't rows in it.

Anybody can help me?

Thanks to everybody and sorry for my english


Post by Serious » Mon 16 Jan 2006 12:35

As described in MySqlDataTable.Active property documentation
Setting the property to false clears the data and frees the memory.
Hence when you in your code set this property to true data is populated from database, and when you set it to false (in finally block) data is cleared.

For more information about MySqlDataTable component please refer to its documentation and corresponding demo projects.

Posts: 2
Joined: Sun 15 Jan 2006 12:32


Post by abraiante » Mon 16 Jan 2006 13:12

Thanks a lot for the answer.

It works fine now.

Post Reply