예제 #1
0
파일: LogReader.cs 프로젝트: harite/SqlChop
 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();
 }
예제 #2
0
        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();
        }
예제 #3
0
 public void Poll(LogSequenceNumber begin)
 {
     Poll(begin, null);
 }
예제 #4
0
파일: LogReader.cs 프로젝트: harite/SqlChop
 public void Poll(LogSequenceNumber begin)
 {
     Poll(begin, null);
 }