Click here to Skip to main content
15,916,042 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to create a class that can be used like a DataTable? Pin
Michael Sync12-Jan-09 5:47
Michael Sync12-Jan-09 5:47 
GeneralRe: How to create a class that can be used like a DataTable? Pin
Not Active12-Jan-09 5:52
mentorNot Active12-Jan-09 5:52 
GeneralRe: How to create a class that can be used like a DataTable? Pin
Michael Sync12-Jan-09 6:03
Michael Sync12-Jan-09 6:03 
GeneralRe: How to create a class that can be used like a DataTable? Pin
Not Active12-Jan-09 8:35
mentorNot Active12-Jan-09 8:35 
Questioncan delegate return multiple values with different datatypes Pin
suni_dotnet12-Jan-09 4:31
suni_dotnet12-Jan-09 4:31 
AnswerRe: can delegate return multiple values with different datatypes Pin
Rutvik Dave12-Jan-09 4:42
professionalRutvik Dave12-Jan-09 4:42 
AnswerRe: can delegate return multiple values with different datatypes Pin
Eddy Vluggen12-Jan-09 4:43
professionalEddy Vluggen12-Jan-09 4:43 
AnswerRe: can delegate return multiple values with different datatypes Pin
Ben Fair12-Jan-09 8:01
Ben Fair12-Jan-09 8:01 
Well it should work using object[] return value from the delegate, but you may need to cast to the proper type. If your delegate it returning object, but it's actually an object[] that's been boxed, just cast the returned object to object[] like so:

public delegate object ExecuteDelegate(int i, string s);
...
object[] values = (object[])ExecuteDelegate(int i, string s);


In this case you just unbox the object[] from the return value into the propery type. Or, if your delegate is returning object[] they should be accessible right away:

public delegate object[] ExecuteDelegate(int i, string s);
...
object[] values = ExecuteDelegate(int i, string s);


It is sometimes helpful to create a class (as others have suggested) to represent the delegate's result values that have meaningful property names, etc., but it really depends on your situation. I'd say if the result data is complex or the delegate is used in multiple places to create a class for it; otherwise, just stick with object[].

Keep It Simple Stupid! (KISS)

AnswerRe: can delegate return multiple values with different datatypes Pin
Jon Rista13-Jan-09 9:48
Jon Rista13-Jan-09 9:48 
Questioninsert date to the data base Pin
abu rakan12-Jan-09 4:24
abu rakan12-Jan-09 4:24 
AnswerRe: insert date to the data base Pin
SeMartens12-Jan-09 4:29
SeMartens12-Jan-09 4:29 
GeneralRe: insert date to the data base Pin
abu rakan12-Jan-09 10:25
abu rakan12-Jan-09 10:25 
GeneralRe: insert date to the data base Pin
SeMartens12-Jan-09 20:58
SeMartens12-Jan-09 20:58 
AnswerRe: insert date to the data base Pin
Wendelius12-Jan-09 12:07
mentorWendelius12-Jan-09 12:07 
Question[Message Deleted] Pin
JGroen12-Jan-09 4:20
JGroen12-Jan-09 4:20 
AnswerRe: INotifyPropertyChanged with user controls Pin
Not Active12-Jan-09 4:44
mentorNot Active12-Jan-09 4:44 
AnswerRe: INotifyPropertyChanged with user controls Pin
Moim Hossain12-Jan-09 4:48
Moim Hossain12-Jan-09 4:48 
QuestionHow to abort filling a dataset? Pin
kasatch12-Jan-09 4:03
kasatch12-Jan-09 4:03 
AnswerRe: How to abort filling a dataset? Pin
benjymous12-Jan-09 4:09
benjymous12-Jan-09 4:09 
AnswerRe: How to abort filling a dataset? Pin
Wendelius12-Jan-09 9:38
mentorWendelius12-Jan-09 9:38 
Questionproblem with timer_tick Pin
prasadbuddhika12-Jan-09 1:04
prasadbuddhika12-Jan-09 1:04 
AnswerRe: problem with timer_tick Pin
Not Active12-Jan-09 1:11
mentorNot Active12-Jan-09 1:11 
GeneralRe: problem with timer_tick Pin
EliottA12-Jan-09 1:17
EliottA12-Jan-09 1:17 
AnswerRe: problem with timer_tick Pin
musefan12-Jan-09 1:41
musefan12-Jan-09 1:41 
GeneralRe: problem with timer_tick Pin
Dave Kreskowiak12-Jan-09 2:15
mveDave Kreskowiak12-Jan-09 2:15 

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.