Precision of data types

  • Thread starter Thread starter Markus Eßmayr
  • Start date Start date
M

Markus Eßmayr

Hi there,

I have a DataSet, filled using a SELECT command.
What I'd like to know is, what precision is defined for decimal columns.

Example:
CREATE TABLE ...... column1 decimal(10, 2) .......

In my application, I need to know, that this columns has 2 digits behind the
comma.

Is there a way?

Thanks in advance!
 
I found out, that SqlDecimal contains all the information i need, but when i
read a value using dataRow["field"], it always returns a System.Decimal.

I don't understand that. Wouldn't SqlDecimal be the correct return type?

Max
 
Hi,

There are no database specific types in DataSet which makes it database
independent.
All specific types are mapped to standard .net types.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Markus Eßmayr said:
I found out, that SqlDecimal contains all the information i need, but when
i
read a value using dataRow["field"], it always returns a System.Decimal.

I don't understand that. Wouldn't SqlDecimal be the correct return type?

Max


Markus Eßmayr said:
Hi there,

I have a DataSet, filled using a SELECT command.
What I'd like to know is, what precision is defined for decimal columns.

Example:
CREATE TABLE ...... column1 decimal(10, 2) .......

In my application, I need to know, that this columns has 2 digits behind the
comma.

Is there a way?

Thanks in advance!
 
Hi,

ok, i understand.
Is there a way to change the DataSet's behaviour to be database specific?
So that Sql* datatypes are used?

Max

Miha Markic said:
Hi,

There are no database specific types in DataSet which makes it database
independent.
All specific types are mapped to standard .net types.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Markus Eßmayr said:
I found out, that SqlDecimal contains all the information i need, but when
i
read a value using dataRow["field"], it always returns a System.Decimal.

I don't understand that. Wouldn't SqlDecimal be the correct return type?

Max


Markus Eßmayr said:
Hi there,

I have a DataSet, filled using a SELECT command.
What I'd like to know is, what precision is defined for decimal columns.

Example:
CREATE TABLE ...... column1 decimal(10, 2) .......

In my application, I need to know, that this columns has 2 digits
behind
the
comma.

Is there a way?

Thanks in advance!
 
Hi Markus,

Markus Eßmayr said:
Hi,

ok, i understand.
Is there a way to change the DataSet's behaviour to be database specific?
So that Sql* datatypes are used?

No.
 
Back
Top