Click here to Skip to main content
15,890,947 members
Home / Discussions / C#
   

C#

 
AnswerRe: computer shop management with sql server connectivity project Pin
Pete O'Hanlon3-May-07 0:54
mvePete O'Hanlon3-May-07 0:54 
GeneralRe: computer shop management with sql server connectivity project Pin
Paul Conrad3-May-07 4:13
professionalPaul Conrad3-May-07 4:13 
AnswerRe: computer shop management with sql server connectivity project Pin
darkelv3-May-07 1:53
darkelv3-May-07 1:53 
QuestionCall to Methods Pin
Subrahmanyam K3-May-07 0:16
Subrahmanyam K3-May-07 0:16 
AnswerRe: Call to Methods Pin
Brady Kelly3-May-07 0:31
Brady Kelly3-May-07 0:31 
GeneralRe: Call to Methods Pin
Subrahmanyam K3-May-07 0:46
Subrahmanyam K3-May-07 0:46 
GeneralRe: Call to Methods Pin
soneliso3-May-07 2:36
soneliso3-May-07 2:36 
AnswerRe: Call to Methods Pin
J. Dunlap3-May-07 0:58
J. Dunlap3-May-07 0: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 1:35
Subrahmanyam K3-May-07 1:35 
AnswerRe: Call to Methods Pin
AFSEKI7-May-07 5:23
AFSEKI7-May-07 5:23 
Questionprinting a crystal report Pin
rkherath2-May-07 23:29
rkherath2-May-07 23:29 
AnswerRe: printing a crystal report Pin
soneliso3-May-07 0:24
soneliso3-May-07 0:24 
GeneralRe: printing a crystal report Pin
rkherath3-May-07 0:38
rkherath3-May-07 0:38 
AnswerRe: printing a crystal report Pin
darkelv3-May-07 1:56
darkelv3-May-07 1:56 
QuestionGet Application directory from console program Pin
Soundman32.22-May-07 23:23
Soundman32.22-May-07 23:23 
GeneralRe: Get Application directory from console program Pin
Soundman32.22-May-07 23:45
Soundman32.22-May-07 23:45 
GeneralRe: Get Application directory from console program Pin
wurzel_cidermaker3-May-07 2:02
wurzel_cidermaker3-May-07 2:02 
AnswerRe: Get Application directory from console program Pin
Brady Kelly3-May-07 0:01
Brady Kelly3-May-07 0:01 
GeneralRe: Get Application directory from console program Pin
Soundman32.23-May-07 0:51
Soundman32.23-May-07 0:51 
AnswerRe: Get Application directory from console program Pin
PIEBALDconsult3-May-07 6:28
mvePIEBALDconsult3-May-07 6:28 
AnswerRe: Get Application directory from console program Pin
Stefan Prodan3-May-07 12:55
Stefan Prodan3-May-07 12:55 
AnswerRe: Get Application directory from console program Pin
AFSEKI7-May-07 5:25
AFSEKI7-May-07 5:25 
QuestionChanging the text of label Pin
sujithkumarsl2-May-07 23:19
sujithkumarsl2-May-07 23:19 
AnswerRe: Changing the text of label Pin
Giorgi Dalakishvili2-May-07 23:28
mentorGiorgi Dalakishvili2-May-07 23:28 
GeneralRe: Changing the text of label Pin
sujithkumarsl2-May-07 23:42
sujithkumarsl2-May-07 23: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.