Im trying to insert a new record though linq. im able to update and read data with out any problem.but i just cant figure out how to just inset a new record. here is a start of my function. i know its not done yeat. all help would be nice.
Public Function AddAddressInfo(ByVal objdeptGUID As String, ByVal objGEOCode As String, ByVal objArressCommonName As String, ByVal objStreetAddress As String, ByVal objAddressNotes As String, ByVal objIsPublic As Boolean, ByVal objSesionToken As String)
''#Check of Token is good
If CheckToken(objSesionToken, objdeptGUID) = False Then
Return "Error"
End If
Try
Dim lqAlarms As New linqAlarmDumpDataContext
Dim AddInfo = From r In lqAlarms.tbAddressInfos
Where r.DeptGUID = objdeptGUID
Select r
Catch ex As Exception
End Try
End Function
Use the InsertOnSubmit()
and SubmitChanges()
to insert your records.
Dim lqAlarms As New linqAlarmDumpDataContext
Dim info As New tbAddressInfo With { ... } ' Create the record
lqAlarms.tbAddressInfos.InsertOnSubmit(info) ' Insert the record
lqAlarms.SubmitChanges() ' Commit the insertion
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With