代码:
Dim dt As DataTable = New DataTable
datatable2 = CType(Session("Result"), DataSet).Tables(0) '数据源
dt = datatable2.Clone() '复制表结构
'导入数据列到数据表
For Each dw As DataRow In datatable2.Select("xorw='" + DropDownList1.SelectedItem.Text + "'")
dt.ImportRow(dw)
Next
DataGrid.DataSource = dt '绑定
DataGrid.DataBind()
datatable2 = CType(Session("Result"), DataSet).Tables(0) '数据源
dt = datatable2.Clone() '复制表结构
'导入数据列到数据表
For Each dw As DataRow In datatable2.Select("xorw='" + DropDownList1.SelectedItem.Text + "'")
dt.ImportRow(dw)
Next
DataGrid.DataSource = dt '绑定
DataGrid.DataBind()