decimal myDecimal = reader.GetDecimal(0);
decimal price = reader.GetDecimal(reader.GetOrdinal("Price"));In both of these examples, we are using the GetDecimal method to retrieve a Decimal value from a SqlDataReader object. The first example uses the column ordinal to specify which column to retrieve the value from, while the second example uses the GetOrdinal method to determine the column ordinal for the "Price" column. Package Library: System.Data.SqlClient is a part of the .NET Framework, so there is no external package library required.