NET Logging Library
LogDataTable Method (ConcreteLog)
Example 



KellermanSoftware.NetLoggingLibrary Namespace > ConcreteLog Class : LogDataTable Method
Log a data table
Syntax
Public Function LogDataTable( _
   ByVal level As LoggingLevel, _
   ByVal table As DataTable, _
   ByVal maxRows As Integer _
) As LogResponse
Dim instance As ConcreteLog
Dim level As LoggingLevel
Dim table As DataTable
Dim maxRows As Integer
Dim value As LogResponse
 
value = instance.LogDataTable(level, table, maxRows)
public LogResponse LogDataTable( 
   LoggingLevel level,
   DataTable table,
   int maxRows
)
public:
LogResponse^ LogDataTable( 
   LoggingLevel level,
   DataTable^ table,
   int maxRows
) 

Parameters

level
table
maxRows
Example
ConcreteLog logger = new ConcreteLog();
 
//Licensed Mode
//logger.UserName = "User Name From Receipt";
//logger.LicenseKey = "LicenseKey From Receipt";            
 
//Clear all configuration
logger.ResetConfiguration();
 
//Add a new target, you can also define targets in an xml file, app.config, or web.config
FileTarget fileTarget = new FileTarget(Environment.CurrentDirectory + "\\fileLogger.txt");
logger.Config.Targets.Add(fileTarget);
 
//Create a test DataTable
DataTable table = new DataTable();
 
//Add columns
table.Columns.Add("CustomerID", typeof(int));
table.Columns.Add("CustomerName", typeof(string));
table.Columns.Add("Country", typeof(string));
 
//Add row to table
table.Rows.Add(new object[] { 1, "Bat Man", "England" });
table.Rows.Add(new object[] { 2, "Cat Woman", "US" });
 
//Log datatable to log
logger.LogDataTable(LoggingLevel.DEBUG, table, 2);
Dim logger As New ConcreteLog()
 
'Licensed Mode
'logger.UserName = "User Name From Receipt";
'logger.LicenseKey = "LicenseKey From Receipt";            
 
'Clear all configuration
logger.ResetConfiguration()
 
'Add a new target, you can also define targets in an xml file, app.config, or web.config
Dim fileTarget As New FileTarget(Environment.CurrentDirectory & "\fileLogger.txt")
logger.Config.Targets.Add(fileTarget)
 
'Create a test DataTable
Dim table As New DataTable()
 
'Add columns
table.Columns.Add("CustomerID", GetType(Integer))
table.Columns.Add("CustomerName", GetType(String))
table.Columns.Add("Country", GetType(String))
 
'Add row to table
table.Rows.Add(New Object() { 1, "Bat Man", "England" })
table.Rows.Add(New Object() { 2, "Cat Woman", "US" })
 
'Log datatable to log
logger.LogDataTable(LoggingLevel.DEBUG, table, 2)
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

ConcreteLog Class
ConcreteLog Members