Click here to Skip to main content
15,880,967 members
Home / Discussions / C#
   

C#

 
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 
There are many things "not so clean" in your code.

Why does that class have a field for the connection string, but otherwise require the connection string to be passed into a public function? Why should a consumer of this class know anything about connection strings?
Also, fields and parameters should "look" differently to avoid confusion of the human reader (I think it is a BUG in Microsoft's specification of scope).

Then there's some UI code also: treeView1_NodeMouseClick. And there is another kind of connection string - now ConnectionString, previously connection_string. Totally confusing.
Also, the else {return;} is not useful.

Obviously, that class is responsible for more than one thing. Hence it needs refactoring to single responsibilities. I am sure that those confusing connection string will be resolved during that refactoring.
Oh sanctissimi Wilhelmus, Theodorus, et Fredericus!

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 
AnswerRe: an interesting aspect of C# 7 extended Tuple semantics Pin
Richard Deeming20-Feb-18 2:32
mveRichard Deeming20-Feb-18 2:32 
GeneralRe: an interesting aspect of C# 7 extended Tuple semantics Pin
BillWoodruff20-Feb-18 4:23
professionalBillWoodruff20-Feb-18 4:23 
GeneralRe: an interesting aspect of C# 7 extended Tuple semantics Pin
Richard Deeming20-Feb-18 4:29
mveRichard Deeming20-Feb-18 4:29 
GeneralRe: an interesting aspect of C# 7 extended Tuple semantics Pin
BillWoodruff20-Feb-18 6:29
professionalBillWoodruff20-Feb-18 6:29 
GeneralRe: an interesting aspect of C# 7 extended Tuple semantics Pin
Richard Deeming20-Feb-18 6:43
mveRichard Deeming20-Feb-18 6:43 
GeneralRe: an interesting aspect of C# 7 extended Tuple semantics Pin
BillWoodruff20-Feb-18 16:17
professionalBillWoodruff20-Feb-18 16:17 
GeneralRe: an interesting aspect of C# 7 extended Tuple semantics Pin
Richard Deeming21-Feb-18 7:50
mveRichard Deeming21-Feb-18 7:50 
GeneralRe: an interesting aspect of C# 7 extended Tuple semantics Pin
BillWoodruff22-Feb-18 4:13
professionalBillWoodruff22-Feb-18 4:13 
GeneralRe: an interesting aspect of C# 7 extended Tuple semantics Pin
Richard Deeming22-Feb-18 7:49
mveRichard Deeming22-Feb-18 7:49 

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.