The function below works in that it returns the correct data back to
the dataset for 2 of the rows in my datalist:
A1 - A - 1
A1 - A - 2
A1 - A - 3
A1 - B - 1
A1 - B - 2
A1 - C - 1
A1 - C - 2
A1 - C - 3
The above dataset is returned as A1 - C - 3
What I would like to do is return A1 - C - C1, C2, C3
I have done a response.write(rowCount) and the correct number of rows
are returned. My main question is how do I go about creating the
string on each row in the dataset? Right now the first row looks like
A1, A2, A3, A4, A5, A6, A7, A8. This is partially correct because there
are 8 rows being returned. How do I configure my FOR NEXT to take it
row by row?
Function GetNewestVersionByProductID(ByVal x As String)
Dim objConn As New
OleDb.OleDbConnection(ConfigurationSettings.AppSet tings("strConnection"))
Dim strSQL As String = "SELECT tblProduct.Drawing,
tblProduct.SheetType, Max(tblProduct.ProductVersion) AS
MaxOfProductVersion, " & _
"Max(ProductRevision.Revision) AS MaxOfProductRevision,
tblProduct.SheetNumber FROM tblProducts " & _
"INNER JOIN (ADCN INNER JOIN Sheet ON ADCN.RecordID =
tblProduct.RecordID) " & _
"ON tblProduct.ProductID = tblRevisions.ProductID WHERE " & _
"tblProduct.ProductID = '" & x & "' AND tblProduct.SheetType = 'SH' " &
_
"GROUP BY tblProduct.ProductType, tblProduct.ProductID,
tblProduct.PageNumber;"
Dim ds As New DataSet
Dim objCommand As New OleDb.OleDbCommand(strSQL, objConn)
Dim myCommand As New OleDb.OleDbDataAdapter(strSQL, objConn)
myCommand.Fill(ds, "tblProducts")
ds.Tables("tblProducts").Columns.Add("ProductVersi onString")
Dim i As Integer = 0
Dim countSheetNumber As Integer = dsADCN.Tables("tblADCN").Rows.Count()
For i = 0 To countSheetNumber - 1
If ds.Tables("tblProducts").Rows(i)("MaxOfProductVers ion") Is Nothing
Then ds.Tables("tblProduct").Rows(i)("ProductVersionStr ing") = "0"
ds.Tables("tblProducts").Rows(0)("ProductVersionSt ring") +=
ds.Tables("tblProduct").Rows(0)("MaxOfProductVersi on") & i + 1
Next
Return ds.Tables("tblProducts").DefaultView
End Function