Click here to Skip to main content
15,925,371 members
Home / Discussions / C#
   

C#

 
GeneralRe: can not obtain local variable value in Visual Studio 2008 Pin
George_George7-Jul-08 21:28
George_George7-Jul-08 21:28 
GeneralRe: can not obtain local variable value in Visual Studio 2008 Pin
leppie7-Jul-08 21:35
leppie7-Jul-08 21:35 
GeneralRe: can not obtain local variable value in Visual Studio 2008 Pin
George_George7-Jul-08 21:47
George_George7-Jul-08 21:47 
QuestionCheck Channel already registered? Pin
ASysSolvers7-Jul-08 21:02
ASysSolvers7-Jul-08 21:02 
QuestionCheck Channel already registered? PinPopular
ASysSolvers7-Jul-08 21:02
ASysSolvers7-Jul-08 21:02 
Questioncreating setup package Pin
Anu Palavila7-Jul-08 20:57
Anu Palavila7-Jul-08 20:57 
QuestionC# / SQL Question - New line in a text field? Pin
Harvey Saayman7-Jul-08 20:54
Harvey Saayman7-Jul-08 20:54 
AnswerRe: C# / SQL Question - New line in a text field? Pin
N a v a n e e t h7-Jul-08 21:37
N a v a n e e t h7-Jul-08 21:37 
GeneralRe: C# / SQL Question - New line in a text field? Pin
Harvey Saayman7-Jul-08 21:47
Harvey Saayman7-Jul-08 21:47 
GeneralRe: C# / SQL Question - New line in a text field? Pin
N a v a n e e t h7-Jul-08 22:47
N a v a n e e t h7-Jul-08 22:47 
QuestionReading values from app.config file [modified] Pin
Tina_K7-Jul-08 20:48
Tina_K7-Jul-08 20:48 
AnswerRe: Reading values from app.config file Pin
Harvey Saayman7-Jul-08 20:58
Harvey Saayman7-Jul-08 20:58 
GeneralRe: Reading values from app.config file Pin
Tina_K8-Jul-08 13:22
Tina_K8-Jul-08 13:22 
QuestionReport viewer error Pin
csp7-Jul-08 20:38
csp7-Jul-08 20:38 
AnswerRe: Report viewer error Pin
Anu Palavila7-Jul-08 21:12
Anu Palavila7-Jul-08 21:12 
QuestionRemoting vs Sockets Pin
nr10002202027-Jul-08 20:22
nr10002202027-Jul-08 20:22 
AnswerRe: Remoting vs Sockets Pin
Rutvik Dave8-Jul-08 8:46
professionalRutvik Dave8-Jul-08 8:46 
QuestionI cant make a full dynamic query in LINQ Pin
mucahit7-Jul-08 20:15
mucahit7-Jul-08 20:15 
AnswerRe: I cant make a full dynamic query in LINQ Pin
leppie7-Jul-08 21:04
leppie7-Jul-08 21:04 
GeneralRe: I cant make a full dynamic query in LINQ Pin
mucahit7-Jul-08 22:04
mucahit7-Jul-08 22:04 
GeneralRe: I cant make a full dynamic query in LINQ Pin
mucahit7-Jul-08 23:05
mucahit7-Jul-08 23:05 
Questionsmart card Data Identification Pin
naveen20_57-Jul-08 18:52
naveen20_57-Jul-08 18:52 
QuestionProblems with generic list data structure Pin
sam L7-Jul-08 18:03
sam L7-Jul-08 18:03 
I have two factory classes that both return a generic list of a data object class. Currently the code is using a switch statement to call a particular factory depending on some input. Code below the switch statement below depends on getting the list of data objects from different sources, but processing them the same.


List<Product> products = null;

switch (i)

{

case 1:

products = ProductFactory.GetProducts();

break;

case 2:

products = ItemFactory.GetItems();

break;

default:

break;

}


The problem is that if I want to add more factories from different sources... I would have to rewrite the code for the current builder class, i.e. add more statements to the switch. Since an unknown number of factory calls could be made to get the data objects from different sources (one factory returns from Oracle, one from SQL one from SAP, etc) the code needs to accommodate any new factory sources without having to recode.


Is there an easy way to accomplish this, please show me some sample code if there's a way to do so.

Thanks

-----------------------------
If you don't go after what you want, you'll never have it.
If you don't ask, the answer is always no. If you don't step
forward, you're always in the same place. -Nora Roberts

AnswerRe: Problems with generic list data structure Pin
leppie7-Jul-08 19:32
leppie7-Jul-08 19:32 
GeneralRe: Problems with generic list data structure Pin
sam L7-Jul-08 20:00
sam L7-Jul-08 20:00 

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.