J
Jason
Hi All,
I've populated a dataset, but need to return the results,
one by one, in numerical order. I can do this easily when
attaching a datagrid to a dataview, but I can't seem to do
it on just the dataset.
Anyone have any ideas on how to do this?
My code is as follows...
dsDistributionLists.ReadXml(Server.MapPath
("../XMLRoutines/4020DistributionLists.xml"))
Dim holdingTable As New DataTable()
Dim distListID As New DataColumn()
holdingTable.TableName = "holdingTable"
distListID.ColumnName = "distListID"
holdingTable.Columns.Add(distListID)
dsDistributionLists.Tables.Add(holdingTable)
Dim dt As DataTable
For Each dt In dsDistributionLists.Tables
If Val(Mid(dt.TableName, 2)) > 7 Then
Dim newRow As DataRow =
dsDistributionLists.Tables("holdingTable").NewRow
newRow(0) = Val(Mid(dt.TableName, 2))
dsDistributionLists.Tables
("holdingTable").Rows.Add(newRow)
End If
Next
***********************
SORTING THING IN HERE
************************
Dim dr As DataRow
For Each dr In dsDistributionLists.Tables
("holdingTable").Rows
Response.Write(dr.Item(0))
Next
I've populated a dataset, but need to return the results,
one by one, in numerical order. I can do this easily when
attaching a datagrid to a dataview, but I can't seem to do
it on just the dataset.
Anyone have any ideas on how to do this?
My code is as follows...
dsDistributionLists.ReadXml(Server.MapPath
("../XMLRoutines/4020DistributionLists.xml"))
Dim holdingTable As New DataTable()
Dim distListID As New DataColumn()
holdingTable.TableName = "holdingTable"
distListID.ColumnName = "distListID"
holdingTable.Columns.Add(distListID)
dsDistributionLists.Tables.Add(holdingTable)
Dim dt As DataTable
For Each dt In dsDistributionLists.Tables
If Val(Mid(dt.TableName, 2)) > 7 Then
Dim newRow As DataRow =
dsDistributionLists.Tables("holdingTable").NewRow
newRow(0) = Val(Mid(dt.TableName, 2))
dsDistributionLists.Tables
("holdingTable").Rows.Add(newRow)
End If
Next
***********************
SORTING THING IN HERE
************************
Dim dr As DataRow
For Each dr In dsDistributionLists.Tables
("holdingTable").Rows
Response.Write(dr.Item(0))
Next