Select from following answers:- Insert
- Update
- Delete
- Upsert
- All Above
In this code segment
Dim db As TestDBEntities = New TestDBEntities()
var result = (from S in db.Students
where S.StudentID = 2
Dim S).Single() As select
basically we are trying to find a record where the StudentId is 2. Once we got then we are setting the new values or updating the values
result.StudentName = "Mr. John Abrar"
result.Address = "6/2 Park Road"
result.Phone = "9658745"
Finally we are saving the updated value
db.Students.ApplyCurrentValues(result)
db.SaveChanges()
Show Correct Answer
Asked In: Many Interviews |
Alert Moderator