I’m helping someone fix a VB application but struggling with a little bit of syntax.
I have the following:
Dim _dt = Datalayer.ConvertSqlDataSourceToDataTable(SqlDataSourceCart)
If _dt.Rows.Count > 0 Then
'For Each here...
End If
What I need to do is loop through every row using a For or For Each loop and get the ProductID field. I think it should be along the lines of:
Dim someString As String
For Each _row As DataRow In _dt.DataSet.Tables(0).Rows
someString += _row(ProductID) & ", "
Next
Assuming _dt is alrady of type
DataTable:or, if you can use LINQ-To-DataSet: