I'm trying to generate a multicolumn listbox in a VB.NET App. It's part of a search form that will display the results of the search. The problem I'm running into is that there is no way to specify columns I know of in VB.NET. You can use a datagrid I suppose, but I want the end user to be able to select the record populated in the lstbox and open up the record (form) directly from the search form. I have tried casting the columns in the query which does list them all, only way out of format due to spacing, etc... I know there is a way to do this as I've seen many apps that have this function. Are multicolumn list boxes allowed in C#? can't remember.
Below is how I'm attempting to accomplish this and it works, kind of, however, it is not acceptable...
Dim sConnectionString, sSQL As String
sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\diw07\My Documents\Daily Backups\phone memo backend.mdb"
sSQL = "SELECT PendingID, PendingClaimNum, Last, First, DatePending, Custodian, [Pending].[PendingClaimNum] & ' ' & [Pending].[Last] & ' ' & [Pending].[First] & ' ' & [Pending].[DatePending] & ' ' & [Pending].[Custodian] As Row FROM Pending WHERE Last Like '" & txtLastName.Text & "'"
'sSQL = "SELECT PendingClaimNum, Last, First, DatePending, Custodian FROM Pending WHERE Last Like '" & txtLastName.Text & "'"
Dim conn As New System.Data.OleDb.OleDbConnection(sConnectionString)
Dim cmd As New System.Data.OleDb.OleDbCommand(sSQL, conn)
Dim dr As System.Data.OleDb.OleDbDataReader
Dim dat As OleDbDataAdapter = New OleDbDataAdapter(sSQL, conn)
Dim dt As New DataSet()
lstResults.DataSource = dt.Tables("Pending").DefaultView
lstResults.DisplayMember = "Row"
lstResults.ValueMember = "PendingID"