Click here to Skip to main content
15,902,636 members
Home / Discussions / C#
   

C#

 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
suprsnipes11-Mar-10 2:58
suprsnipes11-Mar-10 2:58 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
Keith Barrow11-Mar-10 3:15
professionalKeith Barrow11-Mar-10 3:15 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
Richard MacCutchan11-Mar-10 4:37
mveRichard MacCutchan11-Mar-10 4:37 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
suprsnipes11-Mar-10 5:13
suprsnipes11-Mar-10 5:13 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
Richard MacCutchan11-Mar-10 6:33
mveRichard MacCutchan11-Mar-10 6:33 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
DaveyM6911-Mar-10 8:26
professionalDaveyM6911-Mar-10 8:26 
QuestionWeb Service authentification server site Pin
olibara10-Mar-10 23:17
olibara10-Mar-10 23:17 
QuestionProblem with list with generic filter predicate. Pin
ddecoy10-Mar-10 22:47
ddecoy10-Mar-10 22:47 
Consider this example that works:
List<String> list = new List<string>(){"1","2","a","b"};
                   list = list.FindAll(delegate(String s)
                   {
                       if (s != "a")
                       { return false; }
                       return true;
                   });


I can't understand why we can't do this :

List<T> list = (from c in oq select c).ToList();
                   list = list.FindAll(delegate(T o)
                   {
                       if (o.GetType().GetProperty("PropertyName").GetValue(o,null).ToString() != company)
                           { return false; }
                       return true;
                   });


The 'propertyName' is a property that exists in the objects naturally.
This compiles fine but throws an object null reference exception...


Thank you for time...
AnswerRe: Problem with list with generic filter predicate. Pin
Keith Barrow10-Mar-10 23:31
professionalKeith Barrow10-Mar-10 23:31 
GeneralRe: Problem with list with generic filter predicate. Pin
ddecoy10-Mar-10 23:52
ddecoy10-Mar-10 23:52 
GeneralSOLVED Pin
ddecoy11-Mar-10 0:03
ddecoy11-Mar-10 0:03 
QuestionFast execution Pin
sanforjackass10-Mar-10 22:31
sanforjackass10-Mar-10 22:31 
AnswerRe: Fast execution Pin
Saksida Bojan10-Mar-10 22:40
Saksida Bojan10-Mar-10 22:40 
GeneralRe: Fast execution Pin
sanforjackass10-Mar-10 22:53
sanforjackass10-Mar-10 22:53 
GeneralRe: Fast execution Pin
harold aptroot10-Mar-10 22:57
harold aptroot10-Mar-10 22:57 
GeneralRe: Fast execution Pin
sanforjackass10-Mar-10 22:59
sanforjackass10-Mar-10 22:59 
GeneralRe: Fast execution Pin
harold aptroot10-Mar-10 23:02
harold aptroot10-Mar-10 23:02 
GeneralRe: Fast execution Pin
sanforjackass10-Mar-10 23:04
sanforjackass10-Mar-10 23:04 
GeneralRe: Fast execution Pin
harold aptroot10-Mar-10 23:05
harold aptroot10-Mar-10 23:05 
GeneralRe: Fast execution Pin
Rob Philpott10-Mar-10 23:44
Rob Philpott10-Mar-10 23:44 
GeneralRe: Fast execution Pin
harold aptroot11-Mar-10 0:03
harold aptroot11-Mar-10 0:03 
GeneralRe: Fast execution [modified] Pin
Keith Barrow10-Mar-10 23:03
professionalKeith Barrow10-Mar-10 23:03 
AnswerRe: Fast execution Pin
Keith Barrow10-Mar-10 22:41
professionalKeith Barrow10-Mar-10 22:41 
GeneralRe: Fast execution Pin
StarBP11-Mar-10 14:38
StarBP11-Mar-10 14:38 
AnswerRe: Fast execution Pin
Luc Pattyn11-Mar-10 2:14
sitebuilderLuc Pattyn11-Mar-10 2:14 

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.