public void Poll(LogSequenceNumber begin, LogSequenceNumber end) { if (_Command == null) { _Command = new SqlCommand("SELECT * FROM fn_dblog(@Begin, @End) ORDER BY [Current LSN] DESC", _Connection); _Command.Parameters.Add("@Begin", SqlDbType.VarChar); _Command.Parameters.Add("@End", SqlDbType.VarChar); } _Command.Parameters["@Begin"].Value = begin == null ? (object)DBNull.Value : begin.ToString(); _Command.Parameters["@End"].Value = end == null ? (object)DBNull.Value : end.ToString(); SqlDataReader reader = _Command.ExecuteReader(); while (reader.Read()) { if (RecordReceived != null) { RecordInfo record = RecordInfo.BuildRecordInfo(reader, _TableInfoProvider); RecordReceived(record); } } reader.Close(); }
public void Poll(LogSequenceNumber begin) { Poll(begin, null); }