OdbcDataReader.GetDecimal(Int32) Método
Definição
public:
override System::Decimal GetDecimal(int i);
public:
virtual System::Decimal GetDecimal(int i);
public override decimal GetDecimal (int i);
public decimal GetDecimal (int i);
override this.GetDecimal : int -> decimal
abstract member GetDecimal : int -> decimal
override this.GetDecimal : int -> decimal
Public Overrides Function GetDecimal (i As Integer) As Decimal
Public Function GetDecimal (i As Integer) As Decimal
Parâmetros
- i
- Int32
O ordinal da coluna baseado em zero.The zero-based column ordinal.
Retornos
O valor da coluna especificada como um objeto Decimal.The value of the specified column as a Decimal object.
Implementações
Exceções
A conversão especificada não é válida.The specified cast is not valid.
Comentários
As conversões são executadas com base nos recursos subjacentes do driver ODBC.Conversions are performed based on the underlying capabilities of the ODBC driver. Se não houver suporte para a conversão, a chamada do método falhará.If the conversion is not supported then the method call will fail.
Chame IsDBNull para procurar valores nulos antes de chamar este método.Call IsDBNull to look for null values before calling this method.
GetDecimal tem uma precisão máxima de 28.GetDecimal has a maximum precision of 28. A tentativa de recuperar dados decimais com uma precisão maior causará uma exceção.Attempting to retrieve decimal data with a larger precision will cause an exception. Uma solução seria alterar a consulta para converter o tipo decimal em um tipo de dados menor ou converter em cadeia de caracteres ou binário.One solution would be to change the query to cast the decimal type to either a smaller datatype or convert to string or binary.