My recent style of using a database in my applications (web-based and windows-based) has been to create a static class called "DBFunctions"
with functions like
Expand|Select|Wrap|Line Numbers
- public static DataTable GetAllUsers()
- {/**/}
Is closing and re-opening the connection a bad practice? I remember learning that creating a new connection to database is "costly" but that modern db server implentations actually have the connections created already in a pool and your objects just pick one from the pool, thus removing the cost of opening and closing.
Is this true? Or should I put some more thought into the best practice for database usage?