Click here to Skip to main content
15,881,856 members
Home / Discussions / C#
   

C#

 
QuestionC# - showing pdf files from mySQL database without using acrobat reader, how? Pin
Member 1365946625-Feb-18 6:38
Member 1365946625-Feb-18 6:38 
AnswerRe: C# - showing pdf files from mySQL database without using acrobat reader, how? Pin
Dave Kreskowiak25-Feb-18 8:03
mveDave Kreskowiak25-Feb-18 8:03 
AnswerRe: C# - showing pdf files from mySQL database without using acrobat reader, how? Pin
Gerry Schmitz25-Feb-18 14:30
mveGerry Schmitz25-Feb-18 14:30 
AnswerRe: C# - showing pdf files from mySQL database without using acrobat reader, how? Pin
sameer54925-Feb-18 22:14
sameer54925-Feb-18 22:14 
AnswerRe: C# - showing pdf files from mySQL database without using acrobat reader, how? Pin
Eddy Vluggen26-Feb-18 0:10
professionalEddy Vluggen26-Feb-18 0:10 
QuestionMessage Removed Pin
23-Feb-18 9:25
Member 1369343023-Feb-18 9:25 
QuestionMemory leak when converting Bitmap to BitmapImage Pin
Leif Simon Goodwin21-Feb-18 23:55
Leif Simon Goodwin21-Feb-18 23:55 
QuestionC# - How to find total rows affected when using EventLogReader (eventLogQuery)? Pin
Shanmuga Sundaram21-Feb-18 19:56
Shanmuga Sundaram21-Feb-18 19:56 
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?


C#
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;

AnswerRe: C# - How to find total rows affected when using EventLogReader (eventLogQuery)? Pin
Gerry Schmitz22-Feb-18 11:53
mveGerry Schmitz22-Feb-18 11:53 
GeneralRe: C# - How to find total rows affected when using EventLogReader (eventLogQuery)? Pin
Shanmuga Sundaram22-Feb-18 19:22
Shanmuga Sundaram22-Feb-18 19:22 
QuestionIs it ok NOT to pass fields into the methods in the same class as parameters? Pin
User9874320-Feb-18 8:59
professionalUser9874320-Feb-18 8:59 
AnswerRe: Is it ok NOT to pass fields into the methods in the same class as parameters? Pin
Richard MacCutchan20-Feb-18 9:05
mveRichard MacCutchan20-Feb-18 9:05 
GeneralRe: Is it ok NOT to pass fields into the methods in the same class as parameters? Pin
User9874320-Feb-18 9:35
professionalUser9874320-Feb-18 9:35 
GeneralRe: Is it ok NOT to pass fields into the methods in the same class as parameters? Pin
Richard MacCutchan20-Feb-18 9:48
mveRichard MacCutchan20-Feb-18 9:48 
SuggestionRe: Is it ok NOT to pass fields into the methods in the same class as parameters? Pin
Richard Deeming20-Feb-18 10:00
mveRichard Deeming20-Feb-18 10:00 
GeneralRe: Is it ok NOT to pass fields into the methods in the same class as parameters? Pin
User9874316-Mar-18 2:50
professionalUser9874316-Mar-18 2:50 
AnswerRe: Is it ok NOT to pass fields into the methods in the same class as parameters? Pin
Bernhard Hiller20-Feb-18 23:26
Bernhard Hiller20-Feb-18 23:26 
GeneralRe: Is it ok NOT to pass fields into the methods in the same class as parameters? Pin
User9874316-Mar-18 2:59
professionalUser9874316-Mar-18 2:59 
AnswerRe: Is it ok NOT to pass fields into the methods in the same class as parameters? Pin
Eddy Vluggen21-Feb-18 3:03
professionalEddy Vluggen21-Feb-18 3:03 
GeneralRe: Is it ok NOT to pass fields into the methods in the same class as parameters? Pin
User9874316-Mar-18 3:01
professionalUser9874316-Mar-18 3:01 
GeneralRe: Is it ok NOT to pass fields into the methods in the same class as parameters? Pin
Eddy Vluggen16-Mar-18 7:13
professionalEddy Vluggen16-Mar-18 7:13 
AnswerRe: Is it ok NOT to pass fields into the methods in the same class as parameters? Pin
V.21-Feb-18 21:26
professionalV.21-Feb-18 21:26 
GeneralRe: Is it ok NOT to pass fields into the methods in the same class as parameters? Pin
User9874316-Mar-18 3:03
professionalUser9874316-Mar-18 3:03 
GeneralRe: Is it ok NOT to pass fields into the methods in the same class as parameters? Pin
V.16-Mar-18 3:42
professionalV.16-Mar-18 3:42 
Questionan interesting aspect of C# 7 extended Tuple semantics Pin
BillWoodruff20-Feb-18 2:11
professionalBillWoodruff20-Feb-18 2:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.