1)Dim context As New Entities 2)Dim educationName As String = "English" 3)Dim insertingObject As Education = 4)context.Educations.FirstOrDefault(Function(c) c.EducationName = educationName)
5) If insertingObject Is Nothing Then 6) Dim newEducation As New Education 7) newEducation.EducationName = "English" 8) newEducation.EducationDescription ="English Decription" 9) context.Educations.AddObject(newEducation) 10) Dim result = context.SaveChanges() End If
let see what abve code
Let’s say you want to insert new education into education table Fist create object form current context 3,4 check the inserting object already exists if not insert the object to Educations collections. context.SaveChanges() means save modification to the data base permanently Result >0 means no error successfully inserted.
string educationName = "English";
Entities context = new Entities();
Wikis may serve many different purposes. Some permit control over different functions (levels of access). For example, editing rights may permit changing, adding or removing material. Others may permit access without enforcing access control. Other rules may also be imposed for organizing content.