Click here to Skip to main content
15,850,214 members
Home / Discussions / C#
   

C#

 
AnswerRe: computer shop management with sql server connectivity project Pin
Pete O'Hanlon3-May-07 1:54
subeditorPete O'Hanlon3-May-07 1:54 
GeneralRe: computer shop management with sql server connectivity project Pin
Paul Conrad3-May-07 5:13
professionalPaul Conrad3-May-07 5:13 
AnswerRe: computer shop management with sql server connectivity project Pin
darkelv3-May-07 2:53
darkelv3-May-07 2:53 
QuestionCall to Methods Pin
Subrahmanyam K3-May-07 1:16
Subrahmanyam K3-May-07 1:16 
AnswerRe: Call to Methods Pin
Brady Kelly3-May-07 1:31
Brady Kelly3-May-07 1:31 
GeneralRe: Call to Methods Pin
Subrahmanyam K3-May-07 1:46
Subrahmanyam K3-May-07 1:46 
GeneralRe: Call to Methods Pin
soneliso3-May-07 3:36
soneliso3-May-07 3:36 
AnswerRe: Call to Methods Pin
J. Dunlap3-May-07 1:58
J. Dunlap3-May-07 1:58 
I don't know what this is for, but it could be that this could be better designed - for example, having separate classes or object instances for operations on each type of table. Then you could say:
agencyDataSource.ProcessTable();
authorityDataSource.ProcessTable();

In either case, you can have a dictionary to store the methods or objects by name:
//the object way
Dictionary<string, MyDataSourceObject> tableObjs = new Dictionary<string, MyDataSourceObject>();
...
tableObjs["Agency"]=agencyDataSource;
tableObjs["Authority"]=authorityDataSource;
...
tableObjs["Agency"].ProcessTable();
tableObjs["Authority"].ProcessTable();

//the method way
delegate void EmptyDelegate();
Dictionary<string, EmptyDelegate> methods = new Dictionary<string, EmptyDelegate>();
...
methods["Agency"]=ProcessAgencyDataTable;
methods["Authority"]=ProcessAuthorityDataTable;
...
methods["Agency"]();
methods["Authority"]();

Or you could do it using Reflection like Brady mentioned but it's slower as far as perf.



GeneralRe: Call to Methods Pin
Subrahmanyam K3-May-07 2:35
Subrahmanyam K3-May-07 2:35 
AnswerRe: Call to Methods Pin
AFSEKI7-May-07 6:23
AFSEKI7-May-07 6:23 
Questionprinting a crystal report Pin
rkherath3-May-07 0:29
rkherath3-May-07 0:29 
AnswerRe: printing a crystal report Pin
soneliso3-May-07 1:24
soneliso3-May-07 1:24 
GeneralRe: printing a crystal report Pin
rkherath3-May-07 1:38
rkherath3-May-07 1:38 
AnswerRe: printing a crystal report Pin
darkelv3-May-07 2:56
darkelv3-May-07 2:56 
QuestionGet Application directory from console program Pin
Soundman32.23-May-07 0:23
Soundman32.23-May-07 0:23 
GeneralRe: Get Application directory from console program Pin
Soundman32.23-May-07 0:45
Soundman32.23-May-07 0:45 
GeneralRe: Get Application directory from console program Pin
wurzel_cidermaker3-May-07 3:02
wurzel_cidermaker3-May-07 3:02 
AnswerRe: Get Application directory from console program Pin
Brady Kelly3-May-07 1:01
Brady Kelly3-May-07 1:01 
GeneralRe: Get Application directory from console program Pin
Soundman32.23-May-07 1:51
Soundman32.23-May-07 1:51 
AnswerRe: Get Application directory from console program Pin
PIEBALDconsult3-May-07 7:28
mvePIEBALDconsult3-May-07 7:28 
AnswerRe: Get Application directory from console program Pin
Stefan Prodan3-May-07 13:55
Stefan Prodan3-May-07 13:55 
AnswerRe: Get Application directory from console program Pin
AFSEKI7-May-07 6:25
AFSEKI7-May-07 6:25 
QuestionChanging the text of label Pin
sujithkumarsl3-May-07 0:19
sujithkumarsl3-May-07 0:19 
AnswerRe: Changing the text of label Pin
Giorgi Dalakishvili3-May-07 0:28
mentorGiorgi Dalakishvili3-May-07 0:28 
GeneralRe: Changing the text of label Pin
sujithkumarsl3-May-07 0:42
sujithkumarsl3-May-07 0:42 

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.