dotConnect for PostgreSQL Documentation
Devart.Data.PostgreSql Namespace / PgSqlLoaderColumn Class / PgSqlType Property
Example

In This Topic
    PgSqlType Property (PgSqlLoaderColumn)
    In This Topic
    Gets or sets the PgSqlType of the column.
    Syntax
    'Declaration
     
    Public Property PgSqlType As PgSqlType
    public PgSqlType PgSqlType {get; set;}

    Property Value

    A PgSqlType value of the column. The default value is PgSqlType.VarChar.
    Remarks
    Use PgSqlType property to specify PostgreSQL data type for the column.
    Example
    public void GetDataColumns(PgSqlConnection pgConnection)
    {
      pgConnection.Open();
      PgSqlLoader loader = new PgSqlLoader();
      loader.Connection = pgConnection;
      loader.TableName = "load_table";
      PgSqlLoaderColumn myColumn;
      try
      {
        loader.CreateColumns();
        for (int i = 0; i < loader.Columns.Count; i++)
        {
          myColumn = loader.Columns[i];
          Console.WriteLine(myColumn.Name);
          Console.WriteLine(myColumn.PgSqlType.ToString());
          Console.WriteLine(myColumn.Size);
          Console.WriteLine(myColumn.Scale);
          Console.WriteLine(myColumn.Precision);
          Console.WriteLine();
        }
       }
      finally
      {
        pgConnection.Close();
      }
    }
    Public Sub GetDataColumns(ByVal pgConnection As PgSqlConnection)
      pgConnection.Open()
      Dim loader As PgSqlLoader
      loader = New PgSqlLoader
      loader.Connection = pgConnection
      loader.TableName = "load_table"
      Dim myColumn As PgSqlLoaderColumn
      Try
        loader.CreateColumns()
        Dim i As Integer
        For i = 0 To loader.Columns.Count - 1
          myColumn = loader.Columns(i)
          Console.WriteLine(myColumn.Name)
          Console.WriteLine(myColumn.PgSqlType.ToString())
          Console.WriteLine(myColumn.Size)
          Console.WriteLine(myColumn.Scale)
          Console.WriteLine(myColumn.Precision)
          Console.WriteLine()
        Next i
      Finally
        pgConnection.Close()
      End Try
    End Sub
    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