Hi,
I would like to know what are best practices for database queries. I am using C#, mysql database.
I have one application in which I had hardcoded all the database queries. Now client has modified database structure. So I have to again modify those queries and as all the queries are inside code, I need to test application, build it, create installer and do many more things related to deployment.
How to avoid such problems? Where shall we keep our queries? In some plain text file or inside app.config or somewhere else?
I will prefer queries to be configurable so that when something like this happens only configuration needs to be changed, no need to change code or executables.
We are not using stored procedures and no ORM framework also.
Thanks in Advance
Thank you everyone for your valuable inputs. I think in current situation the best I can do is to modify queries and try to emphasize on stored procedures from next time.
Thanks again.