I have a form see attached, I would like the bottom listbox to show other columns from the stored procedure but not sure how
currently the listbox is populated with one column
Private Sub CBCWSelectedItems_SelectedIndexChanged(sender As Object, e As EventArgs) Handles CBCWSelectedItems.SelectedIndexChanged Dim selectedIndex As Integer selectedIndex = CBCWSelectedItems.SelectedIndex Dim selectedItem As Object selectedItem = CBCWSelectedItems.SelectedItem 'MessageBox.Show("Selected Item Text: " & selectedItem.ToString() & Microsoft.VisualBasic.Constants.vbCrLf & ' "Index: " & selectedIndex.ToString()) ListMatrix.DataSource = GetMatrixData(selectedItem.ToString()).AsEnumerable().Select(Function(r) r.Field(Of String)("Word")).ToList() End Sub
the SP does this
o
SELECT [dbo].[TblWords].Word, [ClientName],[StrFull]
FROM [dbo].TblWords
WHERE [word]= 'f18' and [StrFull] like 'f18'+N'%'
GROUP BY [Word], [ClientName],[StrFull]
ORDER BY [Word] ee.JPG ee2.JPG
ListBox control has MultiColumn Property. Which will show values of one field in multiple columns (Horizontal Columns).
But, If you want to show multiple column, you have to use DataGridView or ListView control.
- Deepak Lakkad