Dim instance As NinjaDbPro Dim value As String value = instance.ExportTableToXml(Of T)()
Type Parameters
- T
Dim instance As NinjaDbPro Dim value As String value = instance.ExportTableToXml(Of T)()
NinjaDbPro db = new NinjaDbPro("MyDatabaseDirectory", "MyDatabaseName"); db.Storage = new FileDatabase(); //Licensed Mode //db.UserName = "John Smith 101224"; //db.LicenseKey = "aousdf832jasf=="; db.OpenDatabase(); Person person1 = new Person(); person1.Name = "John"; db.Save(person1); Person person2 = new Person(); person2.Name = "Jane"; db.Save(person2); //Export to a string string result = db.ExportTableToXml<Person>(); //Save to a file System.IO.File.WriteAllText("Persons.xml", result); db.CloseDatabase(); //Delete the database db.DeleteEntireDatabase(); db.OpenDatabase(); //Import it back in db.ImportTableFromXml<Person>(result); Person personCopy = db.Load<Person>(person1.PersonId);
Dim db As New NinjaDbPro("MyDatabaseDirectory", "MyDatabaseName") db.Storage = New FileDatabase() 'Licensed Mode 'db.UserName = "John Smith 101224"; 'db.LicenseKey = "aousdf832jasf=="; db.OpenDatabase() Dim person1 As New Person() person1.Name = "John" db.Save(person1) Dim person2 As New Person() person2.Name = "Jane" db.Save(person2) 'Export to a string Dim result As String = db.ExportTableToXml(Of Person)() 'Save to a file System.IO.File.WriteAllText("Persons.xml", result) db.CloseDatabase() 'Delete the database db.DeleteEntireDatabase() db.OpenDatabase() 'Import it back in db.ImportTableFromXml(Of Person)(result) Dim personCopy As Person = db.Load(Of Person)(person1.PersonId)
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