Exemple #1
0
    public OTDataset(OTDataReader reader, object data)
    {
        this.reader = reader;
        this._data = data;

        _row = -1;
        _bof = _eof = true;

        if (data!=null)
        {
            _row = 0;
            _bof = _eof = false;
        }
    }
Exemple #2
0
    /// <summary>
    /// Registeres the specified newReader.
    /// </summary>
    /// <remarks>
    /// When OTDataReader.keepReaders is true and you are registering a new reader using OTDataReader.Register(newReader) and the new reader has 
    /// the same id as one that is already available the reader will re-use that already available reader.
    /// </remarks>
    public static OTDataReader Register(OTDataReader newReader)
    {
        string id = newReader.id;

        if (lookup.ContainsKey(id) && !keepReaders)
            lookup[id].Close();

        if (!lookup.ContainsKey(id))
        {
            all.Add(newReader);
            lookup.Add(id,newReader);
        }

        return lookup[id];
    }