Click here to Skip to main content
16,005,120 members
Home / Discussions / C#
   

C#

 
GeneralHow to cook fries. Urgent. Plz Help. Pin
Malcolm Smart21-Nov-07 1:10
Malcolm Smart21-Nov-07 1:10 
JokeRe: How to cook fries. Urgent. Plz Help. Pin
Pete O'Hanlon21-Nov-07 1:14
mvePete O'Hanlon21-Nov-07 1:14 
QuestionPInvoke in c# Pin
m@u20-Nov-07 22:43
m@u20-Nov-07 22:43 
AnswerRe: PInvoke in c# Pin
Malcolm Smart21-Nov-07 1:12
Malcolm Smart21-Nov-07 1:12 
GeneralRe: PInvoke in c# Pin
m@u21-Nov-07 1:48
m@u21-Nov-07 1:48 
AnswerRe: PInvoke in c# Pin
Alan N21-Nov-07 8:22
Alan N21-Nov-07 8:22 
GeneralRe: PInvoke in c# Pin
m@u21-Nov-07 9:36
m@u21-Nov-07 9:36 
Question.Net 1.1 EventLogEntry.Message - memory leak Pin
rrunner720-Nov-07 22:14
rrunner720-Nov-07 22:14 
Hello,

I am trying to write a service in .NET 1.1 and .NET 2.0 which will catch a event and send it to SQL DB.
The issue is with .NET 1.1 service, the service on .NET 2.0 has no issues and is running without any problems. The service running under .NET 1.1 has a memory leak. I found out that when I use the property "EventLogEntry.Message", .NET 1.1 create for each entry 2 string variables with values "HKLM\System\CurrentControlSet\Services\EventLog". The second string is the same value only on the end of the string is the name of the eventlog file to which a event was written. Does anybody know if this is a bug in the .NET 1.1 framework or do I made a misstake somewere ?

This is a portion my code:
QueryApp = "INSERT INTO " + ComputerName + "_Application" +<br />
                            " (Category,CategoryString,EventCode,EventType,SourceName,TimeGenerated,TimeWritten,Message,UserName) values " +<br />
                            "(" + currentEntry.CategoryNumber + ",'" + currentEntry.CategoryNumber.ToString() + "'," + currentEntry.EventID + ",'" + Convert.ToString(currentEntry.EntryType) + "','" + currentEntry.Source +<br />
                            "','" + currentEntry.TimeGenerated.Month.ToString() + ". " + currentEntry.TimeGenerated.Day.ToString() + ". " + currentEntry.TimeGenerated.Year.ToString() + " " + currentEntry.TimeGenerated.Hour.ToString() + ":" + currentEntry.TimeGenerated.Minute.ToString() + ":" + currentEntry.TimeGenerated.Second.ToString() +<br />
                            "','" + currentEntry.TimeWritten.Month.ToString() + ". " + currentEntry.TimeWritten.Day.ToString() + ". " + currentEntry.TimeWritten.Year.ToString() + " " + currentEntry.TimeWritten.Hour.ToString() + ":" + currentEntry.TimeWritten.Minute.ToString() + ":" + currentEntry.TimeWritten.Second.ToString() +<br />
                            "','" + currentEntry.Message.Replace("'", "''") + "','" + currentEntry.UserName + "')";<br />
                        OleDbCommand commandApp = new OleDbCommand(QueryApp, connection);<br />
                        commandApp.ExecuteNonQuery();<br />
                        commandApp.Dispose();<br />
                        commandApp = null;<br />
                        QueryApp = null;<br />


if you need to see the whole code just tell me I will pase the whole function.

Thank you
Martin
Questionhow to convert string to decimal Pin
Sunil Wise20-Nov-07 22:11
professionalSunil Wise20-Nov-07 22:11 
AnswerRe: how to convert string to decimal Pin
Sun Rays20-Nov-07 22:20
Sun Rays20-Nov-07 22:20 
GeneralRe: how to convert string to decimal Pin
Sunil Wise20-Nov-07 22:33
professionalSunil Wise20-Nov-07 22:33 
AnswerRe: how to convert string to decimal Pin
N a v a n e e t h20-Nov-07 22:23
N a v a n e e t h20-Nov-07 22:23 
AnswerRe: how to convert string to decimal Pin
Pete O'Hanlon20-Nov-07 22:24
mvePete O'Hanlon20-Nov-07 22:24 
AnswerRe: how to convert string to decimal Pin
Shpendh20-Nov-07 22:29
Shpendh20-Nov-07 22:29 
AnswerRe: how to convert string to decimal Pin
Andrei Ungureanu20-Nov-07 22:31
Andrei Ungureanu20-Nov-07 22:31 
Questionwhere this project ? Pin
abcomp0120-Nov-07 21:49
abcomp0120-Nov-07 21:49 
AnswerRe: where this project ? Pin
Mustafa Ismail Mustafa20-Nov-07 21:56
Mustafa Ismail Mustafa20-Nov-07 21:56 
AnswerRe: where this project ? Pin
abcomp0121-Nov-07 1:24
abcomp0121-Nov-07 1:24 
QuestionRe: where this project ? Pin
abcomp0121-Nov-07 1:26
abcomp0121-Nov-07 1:26 
AnswerRe: where this project ? Pin
Andrei Ungureanu21-Nov-07 1:35
Andrei Ungureanu21-Nov-07 1:35 
AnswerRe: where this project ? Pin
Sukhjinder_K21-Nov-07 5:15
Sukhjinder_K21-Nov-07 5:15 
Questionit send data to tcp/ip port number, ex 8080, now i want to write socket program to read data from that port. Any body help me? How can i do that? Pin
sivaramireddy p20-Nov-07 21:31
sivaramireddy p20-Nov-07 21:31 
AnswerRe: it send data to tcp/ip port number, ex 8080, now i want to write socket program to read data from that port. Any body help me? How can i do that? Pin
Andrei Ungureanu20-Nov-07 21:52
Andrei Ungureanu20-Nov-07 21:52 
GeneralRe: it send data to tcp/ip port number, ex 8080, now i want to write socket program to read data from that port. Any body help me? How can i do that? Pin
sivaramireddy p20-Nov-07 22:09
sivaramireddy p20-Nov-07 22:09 
GeneralRe: it send data to tcp/ip port number, ex 8080, now i want to write socket program to read data from that port. Any body help me? How can i do that? Pin
Andrei Ungureanu20-Nov-07 22:19
Andrei Ungureanu20-Nov-07 22:19 

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.