This project has moved and is read-only. For the latest updates, please go here.

You have many methods to save an entity to database...

First Method

Dim Cust As New Customer
Cust.FirstName = "Homer"
Cust.LastName = "Simpson"
Cust.Address = "Evergreen Terrace, 740"
Dim IdInserted As Integer = Cust.Save



Second Method

Dim Cust As New Customer
Cust.FirstName = "Homer"
Cust.LastName = "Simpson"
Cust.Address = "Evergreen Terrace, 740"

Dim IdInserted As Integer = 0

Using MgrCust as new CustomersDAO
   IdInserted = MgrCust.Save(Cust)
End Using



NOTE
In all example IdInserted variable you have the new Id for this object

BEST PRATICES
Every time use a DAOClass use them with Using Instruction

Last edited Mar 12, 2014 at 12:30 PM by Lunadix, version 1