المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Postgres database connection



C# Programming
03-02-2011, 05:32 PM
I am new to databases and C#. In my main program in C#, I can open a connection to postgresdb , do some queries and close connection afterwards. But, I don't like to open it up every time I query the db, is there a way where the db stays opened for the life of the application, so I can query things anytime through out the life of the program and only close when I kill the app.... How is it normally done in big apps that query db quite often?

Is this the right way of doing it, or am i missing something here?

Thanks