PeterBaileyUk
asked on
Multi column vb.net listbox
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
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
Can you please explain, what do you want to do with multi columns?
- Deepak Lakkad
Can you please explain, what do you want to do with multi columns?
- Deepak Lakkad
ASKER
I experimented and did this
DataGridView1.DataSource = GetMatrixData("F18")
works fine
DataGridView1.DataSource = GetMatrixData("F18")
works fine
Good
ASKER