DBMapper Class

DBMappers are used to store a range of data in Excel to the database. A special type of DBMapper is the CUD DBMapper for realizing the former DBSheets

Inheritance Hierarchy

Namespace: DBaddinAssembly: DBaddin in (DBaddin.dll)

Syntax

public class DBMapper : DBModif

The DBMapper type exposes the following members.

Constructors

ClassSummary
public constructorDBMapper(CustomXMLNode, Range)
constructor with definition XML

Methods

NameSummary
public methodaddHiddenFeatureDefs(CustomXMLNode)
to re-add hidden features only available in XML
public methodDBModifSaveNeeded()
checks whether DBModifier needs saving, either because execOnSave is set or in case of CUD DBMappers if any i/u/d Flags are present
public methoddoDBModif(Boolean, String, Boolean)
execute the modifications for the DB Mapper by storing the data modifications in the DBMapper range to the database
public methodextendDataRange()
extend DataRange to "whole" DBMApper area (first row (header/field names) to the right and first column (first primary key) down)
public methodhadChanges()
public methodinsertCUDMarks(Range, Boolean)
inserts CUD (Create/Update/Delete) Marks at the right end of the DBMapper range
private methodnotifyUserOfDataError(String, Int64, Int32)
notification of error for user including selection of error cell
public methodresetCUDFlags()
reset CUD FLags, either after completion of doDBModif or on request (refresh)
public methodsetDBModifCreateFields(ref DBModifCreate)
set the fields in the DB Modifier Create Dialog with attributes of object

Fields

NameDescription
private fieldAutoIncFlag
first column is treated as an auto-incrementing key column, needed to ignore empty values there (otherwise DBMappers stop here)
private fieldavoidFill
prevent filling of whole table during execution of DB Mappers, this is useful for very large tables that are incrementally filled and would take unnecessary long time to start the DB Mapper. If set to true then each record is searched independently by going to the database. If the records to be stored are not too many, then this is more efficient than loading a very large table.
private fieldchangesDone
used to pass whether changes were done
public fieldCUDFlags
respect C/U/D Flags (DBSheet functionality)
private fielddeleteBeforeMapperInsert
if set, delete table before inserting the contents of DBMapper
private fieldexecuteAdditionalProc
additional stored procedure to be executed after saving
private fieldignoreColumns
columns to be ignored (helper columns)
private fieldIgnoreDataErrors
if set, don't notify error values in cells during update/insert
private fieldinsertIfMissing
if set, then insert row into table if primary key is missing there. Default = False (only update)
private fieldonlyRefreshTheseDBSheetLookups
contains cells in DBSheetLookups with lookups that should only be refreshed after DB modification was done. If empty, all lookups are refreshed for that DB Modifier/Sheet
private fieldpreventColResize
flag to prevent automatic resizing of columns
private fieldprimKeysCount
count of primary keys in data-table, starting from the leftmost column
private fieldtableName
Database Table, where Data is to be stored