Exemplo n.º 1
0
        private static ItemTy ReadSingleScalar <ItemTy>(SafeDataReader dr)
        {
            ItemTy rval = default(ItemTy);

            if (dr.Read())
            {
                rval = (ItemTy)dr.GetValue(0);
            }

            return(rval);
        }
Exemplo n.º 2
0
        private static List <ItemTy> ReadScalarList <ItemTy>(SafeDataReader dr)
        {
            List <ItemTy> rval = new List <ItemTy>();

            while (dr.Read())
            {
                ItemTy i = (ItemTy)dr.GetValue(0);
                rval.Add(i);
            }

            return(rval);
        }
Exemplo n.º 3
0
        static private List <ItemTy> ReadScalarList <ItemTy>(SafeDataReader dr)
        {
            List <ItemTy> rval = new List <ItemTy>();

            //if (!typeof(ItemTy).IsPrimitive)
            //{
            //    throw new Exception(
            //        "Attempted to use scalar reader for non-scalar type!");
            //}

            while (dr.Read())
            {
                rval.Add((ItemTy)dr.GetValue(0));
            }

            return(rval);
        }
Exemplo n.º 4
0
        static private ItemTy ReadSingleScalar <ItemTy>(SafeDataReader dr)
        {
            ItemTy rval = default(ItemTy);

            if (!typeof(ItemTy).IsPrimitive)
            {
                throw new Exception(
                          "Attempted to use scalar reader for non-scalar type!");
            }

            if (dr.Read())
            {
                rval = (ItemTy)dr.GetValue(0);
            }

            return(rval);
        }