[ADO.NET]設定DataSet的PK與mulitPK的資料搜尋
'設定DataSet的PK
Dim colPk(1) As DataColumn
colPk(0) = myDataSet.Tables("authority_group_program").Columns("agp_group_no")
colPk(1) = myDataSet.Tables("authority_group_program").Columns("agp_program_no")
myDataSet.Tables("authority_group_program").PrimaryKey = colPk
'mulitPK的資料搜尋
Dim findProgramVals(1) As Object
findProgramVals(0) = _item.Cells(0).Text.Trim
findProgramVals(1) = _item.Cells(1).Text.Trim
myDataRow = myDataSet.Tables("authority_group_program").Rows.Find(findProgramVals)
Dim colPk(1) As DataColumn
colPk(0) = myDataSet.Tables("authority_group_program").Columns("agp_group_no")
colPk(1) = myDataSet.Tables("authority_group_program").Columns("agp_program_no")
myDataSet.Tables("authority_group_program").PrimaryKey = colPk
'mulitPK的資料搜尋
Dim findProgramVals(1) As Object
findProgramVals(0) = _item.Cells(0).Text.Trim
findProgramVals(1) = _item.Cells(1).Text.Trim
myDataRow = myDataSet.Tables("authority_group_program").Rows.Find(findProgramVals)
留言