Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
AnswerRe: C # if statement (parameter read form sql Server DB) Pin
ZurdoDev28-Feb-14 10:56
professionalZurdoDev28-Feb-14 10:56 
QuestionMessage Closed Pin
27-Feb-14 20:31
Member 1063210727-Feb-14 20:31 
AnswerRe: plz Pin
V.27-Feb-14 20:46
professionalV.27-Feb-14 20:46 
AnswerRe: plz Pin
Bernhard Hiller27-Feb-14 20:48
Bernhard Hiller27-Feb-14 20:48 
AnswerRe: plz Pin
ScottM127-Feb-14 20:53
ScottM127-Feb-14 20:53 
AnswerRe: plz Pin
GuyThiebaut27-Feb-14 22:01
professionalGuyThiebaut27-Feb-14 22:01 
GeneralRe: plz Pin
Richard MacCutchan27-Feb-14 22:14
mveRichard MacCutchan27-Feb-14 22:14 
AnswerRe: plz PinPopular
Pete O'Hanlon28-Feb-14 0:29
mvePete O'Hanlon28-Feb-14 0:29 
Excellent, I'm delighted that you have the chance to display your abilities in developing an application. Now is your opportunity to prove that you were really listening in your lessons, and that you have the ability to go off and do some research and abstract thinking on your own.

Fortunately for you, the question provides several clues as to what you need to be looking at. The first thing is that you need a generic method. Now, this could mean a couple of things so I'll go over them both with you. The first thing it could mean is that it is a method that has a generic parameter, while the second thing is that it might accept a generic type as an input. I know that seems complicated but it makes more sense when you look at the next requirement that it will accept a list of elements.

Right, your method accepts a generic list. We still haven't decided whether it's a generic parameter or a generic type, but you have some clues that you need a generic list. I suggest you look up List<T> to get an understanding of what I'm talking about (now, you could be really clever and allow the method to accept any type that implements IList<T> but I think you should limit yourself to the basics for the moment). So, you have a List of type T - this is a generic. Now, you could either create your method using something like void MyMethod<TList, TType>(TList items) or void MyMethod<T>(List<T> items). It's up to you, but you need to decide now whether or not you need to apply generic constraints to T. At this point, you really need to decide what elements actually means - does it mean you limit to classes, or do you allow primitive types as well.

The iteration part is trivial - you really should be able to accomplish that on your own.
GeneralRe: plz Pin
Wayne Gaylard28-Feb-14 1:59
professionalWayne Gaylard28-Feb-14 1:59 
AnswerRe: plz Pin
Ennis Ray Lynch, Jr.28-Feb-14 5:15
Ennis Ray Lynch, Jr.28-Feb-14 5:15 
QuestionHow to click on a node in treeview and display and edit data in listview Pin
daddy35627-Feb-14 18:14
daddy35627-Feb-14 18:14 
AnswerRe: How to load an xml into a treeview then when clicked on an item shows in listview Pin
BillWoodruff27-Feb-14 21:51
professionalBillWoodruff27-Feb-14 21:51 
AnswerRe: How to click on a node in treeview and display and edit data in listview Pin
BillWoodruff1-Mar-14 14:13
professionalBillWoodruff1-Mar-14 14:13 
AnswerRe: How to click on a node in treeview and display and edit data in listview Pin
BillWoodruff8-Mar-14 4:04
professionalBillWoodruff8-Mar-14 4:04 
GeneralRe: How to click on a node in treeview and display and edit data in listview Pin
daddy3569-Mar-14 12:04
daddy3569-Mar-14 12:04 
GeneralRe: How to click on a node in treeview and display and edit data in listview Pin
BillWoodruff9-Mar-14 21:04
professionalBillWoodruff9-Mar-14 21:04 
GeneralRe: How to click on a node in treeview and display and edit data in listview Pin
daddy3569-Mar-14 21:19
daddy3569-Mar-14 21:19 
GeneralRe: How to click on a node in treeview and display and edit data in listview Pin
BillWoodruff9-Mar-14 21:41
professionalBillWoodruff9-Mar-14 21:41 
GeneralRe: How to click on a node in treeview and display and edit data in listview Pin
BillWoodruff9-Mar-14 23:28
professionalBillWoodruff9-Mar-14 23:28 
GeneralRe: How to click on a node in treeview and display and edit data in listview Pin
daddy35611-Mar-14 5:38
daddy35611-Mar-14 5:38 
QuestionInsert into sql fails. Pin
Member 1063165027-Feb-14 16:12
Member 1063165027-Feb-14 16:12 
AnswerRe: Insert into sql fails. Pin
ScottM127-Feb-14 20:31
ScottM127-Feb-14 20:31 
AnswerRe: Insert into sql fails. Pin
V.27-Feb-14 20:53
professionalV.27-Feb-14 20:53 
AnswerRe: Insert into sql fails. Pin
Mycroft Holmes28-Feb-14 13:15
professionalMycroft Holmes28-Feb-14 13:15 
GeneralRe: Insert into sql fails. Pin
Member 106409593-Mar-14 19:22
Member 106409593-Mar-14 19:22 

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.