dotConnect for PostgreSQL Documentation
Devart.Data.PostgreSql Namespace / PgSqlLoaderColumnCollection Class / Add Method / Add(String,PgSqlType,Int32,Int32,Int32) Method
The name of the column.
One of the PgSqlType values.
Maximum size of the column data (only for strings).
The precision of the column.
The scale of the column.
Example

In This Topic
Add(String,PgSqlType,Int32,Int32,Int32) Method
In This Topic
Adds a PgSqlLoaderColumn to the PgSqlLoaderColumnCollection given the column name, column data type, column size, precision, and scale.
Syntax
'Declaration
 
Public Overloads Function Add( _
   ByVal name As String, _
   ByVal dbType As PgSqlType, _
   ByVal size As Integer, _
   ByVal precision As Integer, _
   ByVal scale As Integer _
) As Integer
 

Parameters

name
The name of the column.
dbType
One of the PgSqlType values.
size
Maximum size of the column data (only for strings).
precision
The precision of the column.
scale
The scale of the column.

Return Value

The new column's ordinal.
Example
The following example creates a PgSqlLoaderColumnCollection, adds an instance of PgSqlLoaderColumn to the collection, and returns a reference to the new PgSqlLoaderColumn.
public void CreatePgLoaderColumnColl(PgSqlLoader myLoader)
{
  PgSqlLoaderColumnCollection myColumnCollection = myLoader.Columns;
  myColumnCollection.Add("DeptNo", PgSqlType.Int);
  myColumnCollection.Add("DName", PgSqlType.VarChar);
  myColumnCollection.Add("Loc", PgSqlType.VarChar);
}
Public Sub CreatePgLoaderColumnColl(myLoader As PgSqlLoader)
  Dim myColumnCollection As PgSqlLoaderColumnCollection = myLoader.Columns
  myColumnCollection.Add("DeptNo", PgSqlType.Int)
  myColumnCollection.Add("DName", PgSqlType.VarChar)
  myColumnCollection.Add("Loc", PgSqlType.VarChar)
End Sub 'CreatePgSqlLoaderColumnColl
See Also