Overloads Sub Save(Of T As {Class, New})( _ ByVal list As List(Of T) _ )
Dim instance As IDataHelper Dim list As List(Of T) instance.Save(Of T)(list)
Parameters
- list
- A list of entities to save
Type Parameters
- T
- Generic class type
Overloads Sub Save(Of T As {Class, New})( _ ByVal list As List(Of T) _ )
Dim instance As IDataHelper Dim list As List(Of T) instance.Save(Of T)(list)
//Get the current thread static safe instance of the helper IDataHelper db = DataHelper.SessionFactory(); //Specify User Name and License Key from the receipt, leave blank for trial mode //db.UserName = "John Smith 1234"; //db.LicenseKey = "asdfl219=="; //Log to the console db.EnableLogging(); //Open the database connection db.OpenConnection(); List<Person> persons = new List<Person>(); //Create a new Person to save to the database Person john = new Person(); john.FirstName = "John"; john.LastName = "Smith"; persons.Add(john); //Create a new Person to save to the database Person jane = new Person(); jane.FirstName = "Jane"; jane.LastName = "Smith"; persons.Add(jane); //Save it to the database db.Save(persons); db.CloseConnection();
'Get the current thread static safe instance of the helper Dim db As IDataHelper = DataHelper.SessionFactory() 'Specify User Name and License Key from the receipt, leave blank for trial mode 'db.UserName = "John Smith 1234" 'db.LicenseKey = "asdfl219==" 'Log to the console db.EnableLogging() 'Open the database connection db.OpenConnection() Dim persons As New List(Of Person)() 'Create a new Person to save to the database Dim john As New Person() john.FirstName = "John" john.LastName = "Smith" persons.Add(john) 'Create a new Person to save to the database Dim jane As New Person() jane.FirstName = "Jane" jane.LastName = "Smith" persons.Add(jane) 'Save it to the database db.Save(persons) db.CloseConnection()
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2