Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

OdbcParameter::Precision Property

 
obsoleteCodeEntity

Gets or sets the number of digits used to represent the Value property.

Namespace:   System.Data.Odbc
Assembly:  System.Data (in System.Data.dll)

public:
property unsigned char Precision {
	virtual unsigned char get() sealed;
	virtual void set(unsigned char value) sealed;
}

Property Value

Type: System::Byte

The maximum number of digits used to represent the Value property. The default value is 0, which indicates that the data provider sets the precision for Value.

Setting this property to a value other than the value in the database depends on the implementation of the data provider and may return an error code, truncate, or round data.

The Precision property only affects parameters whose OdbcType is Decimal or Numeric. For other data types, Precision is ignored.

System_CAPS_noteNote

Use of this property to coerce data passed to the database is not supported. To round, truncate, or otherwise coerce data before passing it to the database, use the Math class that is part of the System namespace prior to assigning a value to the parameter's Value property.

The following example creates an OdbcParameter and sets some of its properties.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show:
© 2017 Microsoft