Hello every one.,

.. i have this problem about the datagridview..
i try many codes which are being posted by other person to other forum sites. As i can see the codes are really
working, but not for me .. i can add, delete, and retrieve data, but it doesn't show in
datagridview.the codes that are being posted has a button to click with, so that it will display data in datagridview ..i need a code that will automatically display the stored data inside mysql command line client..

can any one help me to find any solution to my problem ..

thanks and godbless=)

I may be misunderstanding your question, but this is pretty much all there is to it to show data in a datagridview.
Just call the method from anywhere and it will display the data in the DataGridView.

Private Sub DisplayDataInDataGridView()
   yourDataGridView.DataSource = Nothing
   Dim con As New MySqlConnection(<your connectionstring>)
   Dim da As MySqlDataAdapter = Nothing
   Dim dt As New DataTable
   Dim SQL As String = ""

      SQL = "<your select query>"
      da = New MySqlDataAdapter(SQL, con)
      yourDataGridView.DataSource = dt
   Catch ex As Exception
      If con.State = ConnectionState.Open Then
      End If
   End Try
End Sub

i would like to query using a text.box then click in button then display what u search in datagridview..how?

This is set up in your SQL at line 9 above.

SQL = "SELECT * FROM someTable WHERE Field1='" & textbox.text & "'"
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.