Click here to Skip to main content
15,895,667 members
Home / Discussions / C#
   

C#

 
QuestionHi! is it possible that my dbase is sql2005 using php and javascript Pin
crisjala2-May-10 23:11
crisjala2-May-10 23:11 
AnswerRe: Hi! is it possible that my dbase is sql2005 using php and javascript Pin
Michel Godfroid2-May-10 23:48
Michel Godfroid2-May-10 23:48 
Questiontypeof() ???? Pin
reza assar2-May-10 23:09
reza assar2-May-10 23:09 
AnswerRe: typeof() ???? [modified] Pin
#realJSOP2-May-10 23:47
mve#realJSOP2-May-10 23:47 
GeneralRe: typeof() ???? Pin
reza assar4-May-10 23:26
reza assar4-May-10 23:26 
AnswerRe: typeof() ???? Pin
PIEBALDconsult3-May-10 4:34
mvePIEBALDconsult3-May-10 4:34 
GeneralRe: typeof() ???? Pin
reza assar4-May-10 23:31
reza assar4-May-10 23:31 
GeneralRe: typeof() ???? Pin
PIEBALDconsult5-May-10 4:13
mvePIEBALDconsult5-May-10 4:13 
Sure. Given a List<System.ValueType> (lis) containing values of different types, this will retrieve the first one that is of a specified type:

private static T
GetValue<T>
(
) where T : struct
{
    T result = default(T) ;

    foreach ( System.ValueType v in lis )
    {
        if ( v.GetType() == typeof(T) )
        {
            result = (T) v ;

            break ;
        }
    }

    return ( result ) ;
}

int i = GetValue<int>() ;


You can easily modify it to use Form rather than ValueType and make it more robust.
QuestionNew Project Ideas? Pin
CoderForEver2-May-10 19:56
CoderForEver2-May-10 19:56 
AnswerRe: New Project Ideas? Pin
Pete O'Hanlon2-May-10 20:42
mvePete O'Hanlon2-May-10 20:42 
GeneralRe: New Project Ideas? Pin
Roger Wright2-May-10 21:11
professionalRoger Wright2-May-10 21:11 
JokeRe: New Project Ideas? Pin
Michel Godfroid2-May-10 22:48
Michel Godfroid2-May-10 22:48 
GeneralRe: New Project Ideas? Pin
MollyTheCoder3-May-10 4:43
MollyTheCoder3-May-10 4:43 
AnswerRe: New Project Ideas? [modified] Pin
wangbo02392-May-10 20:50
wangbo02392-May-10 20:50 
GeneralRe: New Project Ideas? Pin
Pete O'Hanlon2-May-10 20:54
mvePete O'Hanlon2-May-10 20:54 
GeneralRe: New Project Ideas? Pin
Roger Wright2-May-10 21:12
professionalRoger Wright2-May-10 21:12 
GeneralRe: New Project Ideas? Pin
wangbo02392-May-10 23:17
wangbo02392-May-10 23:17 
AnswerRe: New Project Ideas? Pin
Roger Wright2-May-10 21:08
professionalRoger Wright2-May-10 21:08 
GeneralRe: New Project Ideas? Pin
Pete O'Hanlon2-May-10 21:17
mvePete O'Hanlon2-May-10 21:17 
GeneralRe: New Project Ideas? Pin
Roger Wright3-May-10 9:06
professionalRoger Wright3-May-10 9:06 
GeneralRe: New Project Ideas? Pin
CoderForEver3-May-10 19:54
CoderForEver3-May-10 19:54 
GeneralRe: New Project Ideas? Pin
Roger Wright3-May-10 20:27
professionalRoger Wright3-May-10 20:27 
GeneralRe: New Project Ideas? Pin
CoderForEver4-May-10 5:01
CoderForEver4-May-10 5:01 
GeneralRe: New Project Ideas? Pin
Roger Wright4-May-10 12:52
professionalRoger Wright4-May-10 12:52 
AnswerRe: New Project Ideas? Pin
#realJSOP2-May-10 23:26
mve#realJSOP2-May-10 23: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.