captainbulba
❔ Best practice to retrieve MySQL columns
Hello wonderful people!
Can you please help me understanding what would be the best practice to retrieve values of specific columns when I use MySQL query?
Currently, I just hardcode names but this doesn't seem to be the ideal situation.
I see that I can create an enum for the names and use Enum.Login.ToString()
Or
I can index it (like reader[0])
But both options has its flows as I can change the column name / change the order.
What is the best practice to get specific columns? Or what method you personally use for a smaller scale application?
3 replies
Storing login data
Hello everyone!
I am trying to build a simple school management system in console. Once a user login I want to store some of the data in order to avoid querying for that data again. What would be the best approach?
I thought of using static such as
But from what I read this approach is not good as multiple applications can mix up the information.
9 replies