嗨,伙计们,感谢您对事物的所有帮助。我正在使用 linq,我可以很容易地从中获取数据。但我似乎无法更新数据。该程序不会出错,看起来它已经更新,但它没有保存更改。
Public Function UpdateAlarmsbyKey(ByVal objKey As Integer, ByVal IdNumber As String) As Boolean
Dim lqAlarms As New linqAlarmDumpDataContext
Dim GetAlrms = From r In lqAlarms.AlarmDrops _
Where r.Key = objKey _
Select r
For Each Calls In GetAlrms
If Calls.AlarmsHandled = "" Then
Calls.AlarmsHandled = IdNumber
Return True
Else
Calls.AlarmsHandled = Calls.AlarmsHandled & ":" & IdNumber
Return True
End If
Next
Return False
End Function