Knight Data Access Layer
CreateClassFromTable Method (IDataHelper)
Example 




KellermanSoftware.NetDataAccessLayer Namespace > IDataHelper Interface : CreateClassFromTable Method
The namespace
The name of the table
The output path for the C# file
Create a C# class from a table
Syntax
Sub CreateClassFromTable( _
   ByVal namespaceString As String, _
   ByVal tableName As String, _
   ByVal outputFilePath As String _
) 
Dim instance As IDataHelper
Dim namespaceString As String
Dim tableName As String
Dim outputFilePath As String
 
instance.CreateClassFromTable(namespaceString, tableName, outputFilePath)
void CreateClassFromTable( 
   string namespaceString,
   string tableName,
   string outputFilePath
)
void CreateClassFromTable( 
   string* namespaceString,
   string* tableName,
   string* outputFilePath
) 
void CreateClassFromTable( 
   String^ namespaceString,
   String^ tableName,
   String^ outputFilePath
) 

Parameters

namespaceString
The namespace
tableName
The name of the table
outputFilePath
The output path for the C# file
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==";
 
//Open the database connection
db.OpenConnection();
 
db.CreateClassFromTable("ACME.InvoiceSystem.Business", 
                         "Invoices", 
                         string.Format("{0}\\Invoice.cs", 
                                       Environment.CurrentDirectory));
 
//Close the database connection
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=="
 
'Open the database connection
db.OpenConnection()
 
db.CreateClassFromTable("ACME.InvoiceSystem.Business", "Invoices", String.Format("{0}\Invoice.cs", Environment.CurrentDirectory))
 
'Close the database connection
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