Click here to Skip to main content
15,914,074 members
Home / Discussions / C#
   

C#

 
GeneralRe: Adding two types into an array? Pin
bbranded23-Mar-09 7:49
bbranded23-Mar-09 7:49 
GeneralRe: Adding two types into an array? Pin
bbranded23-Mar-09 7:57
bbranded23-Mar-09 7:57 
GeneralRe: Adding two types into an array? Pin
Luc Pattyn23-Mar-09 8:07
sitebuilderLuc Pattyn23-Mar-09 8:07 
GeneralRe: Adding two types into an array? Pin
bbranded23-Mar-09 8:57
bbranded23-Mar-09 8:57 
GeneralRe: Adding two types into an array? Pin
Luc Pattyn23-Mar-09 9:03
sitebuilderLuc Pattyn23-Mar-09 9:03 
GeneralRe: Adding two types into an array? Pin
bbranded23-Mar-09 9:10
bbranded23-Mar-09 9:10 
GeneralRe: Adding two types into an array? Pin
Luc Pattyn23-Mar-09 9:14
sitebuilderLuc Pattyn23-Mar-09 9:14 
AnswerRe: Adding two types into an array? Pin
Samuel Cherinet23-Mar-09 7:46
Samuel Cherinet23-Mar-09 7:46 
AnswerRe: Adding two types into an array? Pin
PIEBALDconsult23-Mar-09 16:16
mvePIEBALDconsult23-Mar-09 16:16 
QuestionLog file Pin
mrithula823-Mar-09 7:20
mrithula823-Mar-09 7:20 
AnswerRe: Log file Pin
Alan N23-Mar-09 7:35
Alan N23-Mar-09 7:35 
GeneralRe: Log file Pin
Vitaliy Tsvayer23-Mar-09 8:43
Vitaliy Tsvayer23-Mar-09 8:43 
GeneralRe: Log file Pin
mrithula823-Mar-09 18:57
mrithula823-Mar-09 18:57 
Questionfinding variables and method names in a source code Pin
emyl2123-Mar-09 7:17
emyl2123-Mar-09 7:17 
AnswerRe: finding variables and method names in a source code Pin
dan!sh 23-Mar-09 7:31
professional dan!sh 23-Mar-09 7:31 
AnswerRe: finding variables and method names in a source code Pin
Samuel Cherinet23-Mar-09 7:51
Samuel Cherinet23-Mar-09 7:51 
QuestionDiscussion: Setting property values from Database using Reflection Pin
Fayu23-Mar-09 5:03
Fayu23-Mar-09 5:03 
When I populate properties in my classes, I usually use reflection to get values from a DataReader and set the values. What do you guys think of this technique? Below is a snipplet:

SqlDataReader dr = new SqlDataReader(); //Assume its populated
PropertyInfo[] properties = this.GetType().GetProperties();
dr.Read(); //Assume only one row exists
foreach (PropertyInfo pf in properties) //Assume no values are null
{
    pf.SetValue(this, dr[pf.Name], null);
}

GeneralRe: Discussion: Setting property values from Database using Reflection Pin
led mike23-Mar-09 5:13
led mike23-Mar-09 5:13 
GeneralRe: Discussion: Setting property values from Database using Reflection Pin
Fayu23-Mar-09 5:16
Fayu23-Mar-09 5:16 
GeneralRe: Discussion: Setting property values from Database using Reflection Pin
led mike23-Mar-09 5:28
led mike23-Mar-09 5:28 
GeneralRe: Discussion: Setting property values from Database using Reflection Pin
Fayu23-Mar-09 5:31
Fayu23-Mar-09 5:31 
GeneralRe: Discussion: Setting property values from Database using Reflection Pin
led mike23-Mar-09 5:42
led mike23-Mar-09 5:42 
AnswerRe: Discussion: Setting property values from Database using Reflection Pin
harold aptroot23-Mar-09 5:44
harold aptroot23-Mar-09 5:44 
AnswerRe: Discussion: Setting property values from Database using Reflection Pin
dan!sh 23-Mar-09 5:55
professional dan!sh 23-Mar-09 5:55 
GeneralRe: Discussion: Setting property values from Database using Reflection Pin
Fayu23-Mar-09 6:02
Fayu23-Mar-09 6:02 

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.