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

Normally the save method can be called to perform an insert or an update.  To explicitly call insert, see the example below. 

'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"

 

'Insert a record into the database using the properties from the object

db.Insert(currentPerson)