Knight Data Access Layer
Saving Records VB.NET
Basic Tasks VB.NET > Saving Data > Saving Records VB.NET


The Save Method will perform an insert, update or delete of a single object or a list of objects.  Here is how it determines what to do:

 

'Get the current instance of the helper

Dim db As IDataHelper = DataHelper.SessionFactory()

 

'Create a new Person to save to the database

Dim currentPerson As New Person()

currentPerson.FirstName = "John"

currentPerson.LastName = "Smith"

 

'Save it to the database

db.Save(currentPerson)