Click here to Skip to main content
15,891,777 members
Home / Discussions / C#
   

C#

 
Questionhow to create new RTF file Pin
raj2313625-Nov-08 0:56
raj2313625-Nov-08 0:56 
AnswerRe: how to create new RTF file Pin
Michael Bookatz5-Nov-08 2:16
Michael Bookatz5-Nov-08 2:16 
QuestionBrowse For Folder Pin
Abdul Rahman Hamidy5-Nov-08 0:27
Abdul Rahman Hamidy5-Nov-08 0:27 
AnswerRe: Browse For Folder Pin
cyber-drugs5-Nov-08 0:31
cyber-drugs5-Nov-08 0:31 
GeneralRe: Browse For Folder Pin
Abdul Rahman Hamidy8-Nov-08 21:49
Abdul Rahman Hamidy8-Nov-08 21:49 
AnswerRe: Browse For Folder Pin
Giorgi Dalakishvili5-Nov-08 0:46
mentorGiorgi Dalakishvili5-Nov-08 0:46 
AnswerRe: Browse For Folder Pin
J4amieC5-Nov-08 0:48
J4amieC5-Nov-08 0:48 
QuestionComparer [modified] Pin
ezazazel5-Nov-08 0:04
ezazazel5-Nov-08 0:04 
Hi!

I have a result from a query where one parameter is always ParameterName and a string.
e.g
ParameterName = ID, ParameterValue = 123
ParameterName = Name, ParameterValue = Eza

Furthermore I have a class which looks like this:
{public double ID {get;set}
public string Name {get;set;}


What I need to do is something like this:
foreach (var item in result)
{
if (item.PropertyName == "ID")
c.ID = item.PropertyValue;
else if (item.PropertyName == "Name")
c.Name == item.PropertyValue;

}


Anyway there must be a smarter approach - the way I get the Data is given and cannot be changed, unfortunately.
The Ideal solution would be to compare the name of the property with the string item.PropertyName:
eg:
foreach (var item in result)
{
c.ID = item.Where(item.ProperyName == c.ID.ToString());
}


How would you solve this?

modified on Wednesday, November 5, 2008 6:13 AM

AnswerRe: Comparer Pin
Guffa5-Nov-08 2:51
Guffa5-Nov-08 2:51 
QuestionReceive replies to a UDP broadcast Pin
Olivier Sannier4-Nov-08 23:39
Olivier Sannier4-Nov-08 23:39 
AnswerRe: Receive replies to a UDP broadcast Pin
Mark Salsbery5-Nov-08 5:22
Mark Salsbery5-Nov-08 5:22 
GeneralRe: Receive replies to a UDP broadcast Pin
Olivier Sannier5-Nov-08 22:28
Olivier Sannier5-Nov-08 22:28 
QuestionDrag and Drop TreeView Pin
Paul Unsworth4-Nov-08 23:36
Paul Unsworth4-Nov-08 23:36 
AnswerRe: Drag and Drop TreeView Pin
cyber-drugs5-Nov-08 0:22
cyber-drugs5-Nov-08 0:22 
GeneralRe: Drag and Drop TreeView Pin
Paul Unsworth5-Nov-08 0:53
Paul Unsworth5-Nov-08 0:53 
GeneralRe: Drag and Drop TreeView Pin
cyber-drugs5-Nov-08 1:04
cyber-drugs5-Nov-08 1:04 
GeneralRe: Drag and Drop TreeView [modified] Pin
DaveyM695-Nov-08 1:27
professionalDaveyM695-Nov-08 1:27 
AnswerRe: Drag and Drop TreeView Pin
Paul Unsworth5-Nov-08 1:53
Paul Unsworth5-Nov-08 1:53 
QuestionHow to comunicate between two different appliaction/forms Pin
WinSolution4-Nov-08 22:47
WinSolution4-Nov-08 22:47 
AnswerRe: How to comunicate between two different appliaction/forms Pin
Giorgi Dalakishvili4-Nov-08 22:53
mentorGiorgi Dalakishvili4-Nov-08 22:53 
QuestionRe: How to comunicate between two different appliaction/forms Pin
WinSolution5-Nov-08 18:33
WinSolution5-Nov-08 18:33 
AnswerRe: How to comunicate between two different appliaction/forms Pin
Giorgi Dalakishvili5-Nov-08 19:25
mentorGiorgi Dalakishvili5-Nov-08 19:25 
AnswerRe: How to comunicate between two different appliaction/forms Pin
Giorgi Dalakishvili7-Nov-08 0:46
mentorGiorgi Dalakishvili7-Nov-08 0:46 
GeneralRe: How to comunicate between two different appliaction/forms Pin
WinSolution7-Nov-08 19:36
WinSolution7-Nov-08 19:36 
QuestionHow do I crop / convert an Image that has Indexed Pixel Format Pin
saberbladez4-Nov-08 22:26
saberbladez4-Nov-08 22:26 

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.