Knight Data Access Layer
LoadLookup(Type) Method
Example 




KellermanSoftware.NetDataAccessLayer Namespace > IDataHelper Interface > LoadLookup Method : LoadLookup(Type) Method
The class type
Return a list of items with the primary key and the first string column ordered by the first string column
Syntax
Overloads Function LoadLookup( _
   ByVal type As Type _
) As Dictionary(Of String,Object)
Dim instance As IDataHelper
Dim type As Type
Dim value As Dictionary(Of String,Object)
 
value = instance.LoadLookup(type)
Dictionary<string,object> LoadLookup( 
   Type type
)

Parameters

type
The class type

Return Value

A list of dictionary records
Example
//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();
 
Dictionary<string,object> records = db.LoadLookup(typeof (Country));
 
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 records As Dictionary(Of String,Object) = db.LoadLookup(GetType(Country))
 
db.CloseConnection()
Requirements

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

See Also

Reference

IDataHelper Interface
IDataHelper Members
Overload List