TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Shanmuga Sundaram
NA
15
1k
How to find total rows affected when using EventLogReader
Feb 22 2018 12:48 AM
I'm trying to read eventlogs from a server which has about 100 000 records using class EventLogReader(eventLogQuery).
I'm using pagination and each page will show only 25 records in my screen. So, I will be reading 25 records out of total records for the first page and next 25 records for the second page and so on.
My question is how to get the total records count for the below snippet like total rows affected because of that eventLogQuery applied on full set of events?
EventLogReader reader =
new
EventLogReader(eventLogQuery);
reader.Seek(SeekOrigin.Begin, filter.PageStart);
eventLogs.TotalLogs = **totalRowsAffected**;
EventRecord eventInstance = reader.ReadEvent();
int
i = filter.PageSize;
while
(eventInstance !=
null
&& i-- > 0)
{
try
{
eventLogs.Entries.Add(
new
EventLogData { Type = eventInstance.LevelDisplayName, Source = eventInstance.ProviderName, Time = eventInstance.TimeCreated, Category = eventInstance.TaskDisplayName, EventId = eventInstance.Id, User = eventInstance.UserId !=
null
? eventInstance.UserId.Value :
""
, Computer = eventInstance.MachineName, Message = eventInstance.FormatDescription(), FullXml = eventInstance.ToXml() });
}
catch
{}
eventInstance = reader.ReadEvent();
}
}
return
eventLogs;
Reply
Answers (
1
)
Using redis as session
how to extract word file and insert into sql database.