Click here to Skip to main content
15,888,816 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Autoescape text Pin
Heath Stewart20-Feb-07 4:51
protectorHeath Stewart20-Feb-07 4:51 
AnswerRe: Autoescape text Pin
Pete O'Hanlon20-Feb-07 5:01
mvePete O'Hanlon20-Feb-07 5:01 
QuestionProblem with handling MDI child closing Pin
CPP_Student19-Feb-07 17:24
CPP_Student19-Feb-07 17:24 
AnswerRe: Problem with handling MDI child closing Pin
tgrt20-Feb-07 3:12
tgrt20-Feb-07 3:12 
GeneralRe: Problem with handling MDI child closing Pin
CPP_Student20-Feb-07 9:24
CPP_Student20-Feb-07 9:24 
QuestionUsing Reflection to get the name of a function parameter. Pin
howardjr19-Feb-07 15:31
howardjr19-Feb-07 15:31 
AnswerRe: Using Reflection to get the name of a function parameter. Pin
Heath Stewart20-Feb-07 4:58
protectorHeath Stewart20-Feb-07 4:58 
GeneralRe: Using Reflection to get the name of a function parameter. Pin
howardjr21-Feb-07 9:57
howardjr21-Feb-07 9:57 
Thank you for your reply.

I've tried to stay away from using strongly typed data sets in favor of "self-healing" code. I'm forced to use VS2003 with .Net 1.1, so this may not be a problem with the later version(s), but when the database changes, i.e., a column goes from not null to null, we've had to update the strongly typed data sets and the programs. I'm more interested in having the code able to deal with nulls directly. However, I'll need to look at the link you gave, it may be that we're not using stongly typed data sets properly.

As I said in my first posting, I want to be able to create a class structure instance to contain all of my database column data. Currently I'm testing the columns for null as they are read from the database using a query. If the value is null then I set a paired member flag variable to true and a 0 or empty string, or some other default value in the value member variable, and if the column isn't null, then I'm setting the flag to false and store the column value in another member variable. The flag member adds the suffix '_Is_Null' to the name of the one used by the value member.

This works well enough, I just need to check the '_Is_Null' suffixed flag member to see if the database value was Null or not to determine how to use the value member variable. However, when it came to sending values back to the database via a stored procedure I wanted to "hide" this code so the assignments easier to read. Instead of passing both the flag member variable and the value member variable to the function in which I was hiding the test, I decided to pass the name of the value member into the function, and use Reflections to look up the paired flag member and its value, then return the appropriate value to be assigned to the stored procedure's parameter. This too works well enough, except that because I was passing in the name of the member as a string instead of the member's value, I'm not able to take advantage of the compiler check for misspelled member names. So, I want to use the value member instead of its name in the function call.

However, when I tried using them with the debugger I could see the data types of the parameters, but I couldn't figure out how to get the names of the variables passed in to them with the function call. Another issue is that Reflections tells me what the containing class's type name is, but not the instanced variable, so if I had more than one instance of the class, how would I know that I'm looking at the right instance when I resolve the paired flag member to see if it is Null (true) or a value (false)? In my current code I hard-code which parent class instance I'm using, this isn't a problem in this one case because there is only one instance of the class, but I'm pretty sure that Reflections techiques could be used inside the function to could get this information from the variable being passed in as the parameter.

Thank you


Questionupdating to framework 3.0 Pin
Darren Sim19-Feb-07 0:38
Darren Sim19-Feb-07 0:38 
AnswerRe: updating to framework 3.0 Pin
Heath Stewart19-Feb-07 7:02
protectorHeath Stewart19-Feb-07 7:02 
GeneralRe: updating to framework 3.0 Pin
Dave Kreskowiak19-Feb-07 10:15
mveDave Kreskowiak19-Feb-07 10:15 
GeneralRe: updating to framework 3.0 Pin
Heath Stewart19-Feb-07 13:13
protectorHeath Stewart19-Feb-07 13:13 
GeneralRe: updating to framework 3.0 Pin
Dave Kreskowiak19-Feb-07 13:19
mveDave Kreskowiak19-Feb-07 13:19 
GeneralRe: updating to framework 3.0 Pin
Kevin McFarlane20-Feb-07 2:24
Kevin McFarlane20-Feb-07 2:24 
GeneralRe: updating to framework 3.0 Pin
Heath Stewart20-Feb-07 4:27
protectorHeath Stewart20-Feb-07 4:27 
GeneralRe: updating to framework 3.0 Pin
Kevin McFarlane20-Feb-07 8:44
Kevin McFarlane20-Feb-07 8:44 
AnswerRe: updating to framework 3.0 Pin
Thomas Stockwell19-Feb-07 7:05
professionalThomas Stockwell19-Feb-07 7:05 
GeneralRe: updating to framework 3.0 Pin
Darren Sim19-Feb-07 22:31
Darren Sim19-Feb-07 22:31 
QuestionMaking things secure enough to be cracked !!! Pin
fulbright18-Feb-07 19:17
fulbright18-Feb-07 19:17 
AnswerRe: Making things secure enough to be cracked !!! Pin
Dave Kreskowiak19-Feb-07 9:36
mveDave Kreskowiak19-Feb-07 9:36 
GeneralRe: Making things secure enough to be cracked !!! Pin
Heath Stewart19-Feb-07 13:26
protectorHeath Stewart19-Feb-07 13:26 
QuestionSystem Colours Pin
Simon P Stevens15-Feb-07 22:56
Simon P Stevens15-Feb-07 22:56 
AnswerRe: System Colours Pin
Thomas Stockwell16-Feb-07 18:45
professionalThomas Stockwell16-Feb-07 18:45 
GeneralRe: System Colours Pin
Simon P Stevens17-Feb-07 2:01
Simon P Stevens17-Feb-07 2:01 
AnswerRe: System Colours Pin
Heath Stewart17-Feb-07 6:07
protectorHeath Stewart17-Feb-07 6:07 

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.