hope you are doing fine.
I have a datatable loaded from a database. I bind the datatable to a gridview on page_load. Now I want to filter the gridview by a user selection so I made a checkboxlist and wrote some code as follow at CheckBoxList1_SelectedIndexChanged
Dim selectedartist As String = CheckBoxList1.SelectedItem.ToString()
Dim dTable As DataTable = Session("dTable")
Dim dTablenew As New DataTable
Dim str As String = "Song_Artist ='" & selectedartist & "'"
dTablenew = dTable.Select(str).CopyToDataTable
GridView1.DataSource = dTablenew
GridView1.DataBind()
With this code above, it can filter if there is only one selection on the checkboxlist. I try to loop the checkboxlist myself but always ended up in errors. Hope someone can help me out to make this work.
Thanks so much.
L
This is the example of the datatable i have

Because you have already used a DataTable extension with
CopyToDataTable:LINQ-To-DataSet
Or in method syntax (in VB.NET not very readable)
Finally, the NET 2.0 DataTable.Select approach: