R
Ryan Ternier
I know how this should be done in regards to nTier, but it seems a bit
inneficient, and was wondering if there's a solution that I havn't thought
of yet.
(I'm switching this loop to For Each Row as DataRow in.... to kill the one
int that's not needed.)
For intCount1 = 0 To
objData.DataSet.Tables("tblSecondaryNumbers").Rows.Count - 1
rowTemp = objData.DataSet.Tables("tblSecondaryNumbers").Rows(intCount1)
If intTempID <> rowTemp("PrimaryID") Then
intTempID = rowTemp("PrimaryID")
strDisplay += " arrSecondary[" & intTempID & "] = new Array();" & vbCr
End If
strDisplay += " arrSecondary[" & intTempID & "][" &
rowTemp("SecondaryID") & "] = """ & _
rowTemp("SecondaryNumber") & " - " & rowTemp("Type") & """;" & vbCr
Next
strDisplay += "</script>" & vbCr
That loop right there uses a DataSet that was passed back. However, it's
only used once, and it's Forward only. It seems logical that a DataReader
should be used instead, saving the resources.
Is using a DataSEt the best solution for it? I was thinking of sending back
an individual table, rather than create a DataSet. Wanted to throw it out
here to see if there was any better solution.
inneficient, and was wondering if there's a solution that I havn't thought
of yet.
(I'm switching this loop to For Each Row as DataRow in.... to kill the one
int that's not needed.)
For intCount1 = 0 To
objData.DataSet.Tables("tblSecondaryNumbers").Rows.Count - 1
rowTemp = objData.DataSet.Tables("tblSecondaryNumbers").Rows(intCount1)
If intTempID <> rowTemp("PrimaryID") Then
intTempID = rowTemp("PrimaryID")
strDisplay += " arrSecondary[" & intTempID & "] = new Array();" & vbCr
End If
strDisplay += " arrSecondary[" & intTempID & "][" &
rowTemp("SecondaryID") & "] = """ & _
rowTemp("SecondaryNumber") & " - " & rowTemp("Type") & """;" & vbCr
Next
strDisplay += "</script>" & vbCr
That loop right there uses a DataSet that was passed back. However, it's
only used once, and it's Forward only. It seems logical that a DataReader
should be used instead, saving the resources.
Is using a DataSEt the best solution for it? I was thinking of sending back
an individual table, rather than create a DataSet. Wanted to throw it out
here to see if there was any better solution.