If e.DataCol.Name Like "日期*" Then Dim idx As String = right(e.DataCol.Name,1) Dim fdr As DataRow = DataTables("温度湿度实时情况").find("时间段 = '" & e.DataRow("时间段") & "' and 日期 = #" & e.NewValue & "#") If fdr IsNot Nothing Then e.DataRow("温度" & idx) = fdr("温度") e.DataRow("湿度" & idx) = fdr("湿度") e.DataRow("值班人" & idx) = fdr("值班人") End If End If