dotConnect for PostgreSQL Documentation
Devart.Data.PostgreSql Namespace / PgSqlNumeric Structure
Members Example

In This Topic
    PgSqlNumeric Structure
    In This Topic
    Syntax
    Remarks
    This structure was created because the System.Decimal type cannot represent all PostgreSQL numeric values. The PgSqlNumeric structure internally stores its value as bytes and allows managing very large numbers.
    Example
    PgSqlCommand insertCommand = new PgSqlCommand("INSERT INTO numeric_test (f_numeric) VALUES (:p1)", connection);
    
    insertCommand.Parameters.Add("p1", PgSqlNumeric.Parse(new string ('9', 50)));
    insertCommand.ExecuteNonQuery();
    
    PgSqlCommand selectCommand = new PgSqlCommand("SELECT f_numeric FROM numeric_test", connection);
    
    using (PgSqlDataReader reader = selectCommand.ExecuteReader())
      while (reader.Read())
    for (int i = 0; i < reader.FieldCount; ++i)
          Console.WriteLine(reader.GetProviderSpecificValue(i));
    Inheritance Hierarchy

    System.Object
       System.ValueType
          Devart.Data.PostgreSql.PgSqlNumeric

    See Also