Hi,
Just a quick question about the best way to display data from a SQL query on a form.
The following code works fine and lists the records in a listbox, but what I would like to do is display the data in a datagrid or flexigrid, but I have not been able to work out how to do it.
Can anyone point me in the right direction.
Thanks in advance for any help
Slim
Dim conA As New Odbc.OdbcConnection
Dim strSql As String = "select * from product"
conA.ConnectionString = "DSN=" & txtDsn.Text & ";Password=" & txtPassword.Text & ";User ID=" & txtUsername.Text
conA.Open()
Dim mycommand As New OdbcCommand(strSql, conA)
Dim myODBCreader As OdbcDataReader = mycommand.ExecuteReader
While myODBCreader.Read
ListBox1.Items.Add(myODBCreader("Bin"))
End While
conA.Close()
myODBCreader.Close()
mycommand.Dispose()