Example #1
0
 // <Snippet1>
 private static void PrintColumn(DataTableReader reader)
 {
     // Loop through all the rows in the DataTableReader
     while (reader.Read())
     {
         if (reader.IsDBNull(2))
         {
             Console.Write("<NULL>");
         }
         else
         {
             try
             {
                 Console.Write(reader.GetFloat(2));
             }
             catch (InvalidCastException)
             {
                 Console.Write("Invalid data type.");
             }
         }
         Console.WriteLine();
     }
 }
 public float GetFloat(int i)
 {
     return(_reader.GetFloat(i));
 }
 public float GetFloat(int _index)
 {
     return(dataReader.GetFloat(_index));
 }