예제 #1
0
        public static ObjectRow ReadAsObjectRow(this SqlDataReader dr, bool getNextResult = true)
        {
            ObjectRow objectRow = null;

            if (dr.Read())
            {
                objectRow = new ObjectRow(dr.FieldCount);

                for (var i = 0; i < dr.FieldCount; i++)
                {
                    objectRow.Add(dr.GetValue(i));
                }
            }

            if (getNextResult)
            {
                dr.NextResult();
            }

            return(objectRow);
        }
예제 #2
0
        public static ObjectRows ReadAsObjectRows(this SqlDataReader dr, bool getNextResult = true)
        {
            var objectRows = new ObjectRows();

            while (dr.Read())
            {
                var objectRow = new ObjectRow(dr.FieldCount);

                for (var i = 0; i < dr.FieldCount; i++)
                {
                    objectRow.Add(dr.GetValue(i));
                }

                objectRows.Add(objectRow);
            }

            if (getNextResult)
            {
                dr.NextResult();
            }

            return(objectRows);
        }