Hi Guys thanks for all the help on things. Im using linq and im able get get data ouf of it realy easy. but i seem to not be able to update the data. the program does not error on it and it looks likes it has updated but it does not save te changes.
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
Try calling -
lqAlarms.SubmitChanges()
after you've updated the Calls.AlarmsHandled
property. Also, your code is looping round a result set but will only change the first record it finds, is that the behaviour you wanted?
精彩评论