Problems with datagrid

Problems with datagrid

Postby abraiante » Sun 15 Jan 2006 12:41

Hello:

I'm using mysqldirect 2.80 with visual studio.net 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 http://www.crlab.com/forums/viewtopic.p ... 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=***")
        Try
            DataGrid1.DataSource = myDataTable
            myDataTable.Active = True
        Finally
            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
abraiante
 
Posts: 2
Joined: Sun 15 Jan 2006 12:32

Postby 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.
Serious
 

Thanks

Postby abraiante » Mon 16 Jan 2006 13:12

Thanks a lot for the answer.

It works fine now.
abraiante
 
Posts: 2
Joined: Sun 15 Jan 2006 12:32


Return to dotConnect for MySQL