See Also

MySqlDecimal Members  | Devart.Data.MySql Namespace

 

Language

Visual Basic

C#

Show All

See AlsoRequirementsLanguagesDevart.Data.MySqlSend comments on this topic.

MySqlDecimal Structure

Represents MySQL type DECIMAL.

For a list of all members of this type, see MySqlDecimal members.

Inheritance Hierarchy

System.Object
   System.ValueType
      Devart.Data.MySql.MySqlDecimal

Syntax

[Visual Basic]
Public Structure MySqlDecimal    Inherits ValueType    Implements INullableIComparable 
[C#]
public struct MySqlDecimal : ValueType, INullableIComparable 

Remarks

This structure was created because the Decimal type cannot handle all MySQL DECIMAL values. Like MySQL Server, the MySqlDecimal structure internally stores its value as a string, which allows working with huge numbers.

Example

The following example demonstrates how to insert to and fetch from a table some MySqlDecimal values.

[C#] 

MySqlCommand insertCommand = new MySqlCommand("INSERT INTO decimal_test (f_decimal) VALUES (:p1)", connection); 
 
 insertCommand.Parameters.Add("p1", MySqlDecimal.MaxValue); 
 insertCommand.ExecuteNonQuery(); 
 
 MySqlCommand selectCommand = new MySqlCommand("SELECT f_decimal FROM decimal_test", connection); 
 
 using (MySqlDataReader reader = selectCommand.ExecuteReader()) 
   while (reader.Read()) 
     for (int i = 0; i < reader.FieldCount; ++i) 
       Console.WriteLine(reader.GetProviderSpecificValue(i));

 

See Also

MySqlDecimal Members  | Devart.Data.MySql Namespace

 

 


© 2002 - 2008 Devart. All Rights Reserved.