[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)

留言

這個網誌中的熱門文章

嘗試卸載資料庫時,發生資料庫正在使用的而無法卸載的可能解決方案

ASP.NET常用的RegularExpressionValidator驗證