Execute sql statement and get datareader - WITH flow control
- by dotnetdev
I have a standard method which gets some data from SQL Server. I want to refactor this so that based on the value of an enum (passed as a method parameter), a different sql statement is executed (all return datareader).
I can't seem to code this in a way which is elegant and tidy. What would be a good way to do this?
Thanks