If arrSyouhinCDList.Count > 0 Then
For i = 0 To arrSyouhinCDList.Count - 1
strSyouhinCD = arrSyouhinCDList(i).ToString
Dim rows() As DataRow
rows = dsM_syouhin_daihyou_kanren.m_syouhin_daihyou_kanren.Select("syouhin_cd='" & strSyouhinCD & "'")
For Each row As DataRow In rows
strDaihyouCD = row.Item("daihyou_cd").ToString
arrDaihyouCDList.Add(strDaihyouCD)
Next
arrAllDaihyouCD.Add(arrDaihyouCDList)
arrDaihyouCDList.Clear()
Next i
End If
select方法里的参数叫"FilterExpression",写法就像拼SQL字符串一样
select方法的返回值是Datarow()(datarow集合,就是多个datarow) 再用for each方法取得想要的值就行了
Powered by ScribeFire.