Click or drag to resize

DBTableCreateNewField Method (DBDriverBase, String, Type, Int32, Int32, Int32, Boolean, Boolean, Int32, LogNode)

Creates a new field based on the elements specified. It assumes there are no fields with the name specified already in this target. The field is added at the end of the fields list.

Namespace:  SD.LLBLGen.Pro.DBDriverCore
Assembly:  SD.LLBLGen.Pro.DBDriverCore (in SD.LLBLGen.Pro.DBDriverCore.dll) Version: 5.10.0.0 (5.10.0)
Syntax
public DBTableField CreateNewField(
	DBDriverBase driverToUse,
	string fieldName,
	Type netType,
	int length,
	int precision,
	int scale,
	bool isNullable,
	bool isPk,
	int preferredDbType,
	out LogNode resultNode
)

Parameters

driverToUse
Type: SD.LLBLGen.Pro.DBDriverCoreDBDriverBase
The driver to use.
fieldName
Type: SystemString
Name of the field.
netType
Type: SystemType
the .NET type to use for choosing the db type, if preferred db type isn't specified.
length
Type: SystemInt32
The length.
precision
Type: SystemInt32
The precision.
scale
Type: SystemInt32
The scale.
isNullable
Type: SystemBoolean
True if the field is nullable
isPk
Type: SystemBoolean
true if the field is part of the PK
preferredDbType
Type: SystemInt32
Preferred db type according to the used type shortcut. If -1, the default database type is used, using the usual filtering. If value of 0 or higher, the dbtype is used, overruling all other types.
resultNode
Type: SD.LLBLGen.Pro.Core.GeneralDataStructuresLogNode
The result node. Is null if everything went OK, not null if error was found. Mainly used to get detailed error messaging to the user why an automap failed.

Return Value

Type: DBTableField
The created new field or null if no field could be created.
Remarks
If there's no compatible type definition found, it will not create any field. Used for auto-generating table fields from mappings. Do not use this routine from a driver to store meta-data, use the DBTableField ctor for that, as this routine will set the CreatedByDesigner flag on the created field.
See Also