Click here to Skip to main content
15,914,406 members
Home / Discussions / C#
   

C#

 
QuestionProblem in sending sms from pc to mobile through AT commands [modified] Pin
aeman1-Mar-11 23:27
aeman1-Mar-11 23:27 
AnswerRe: Problem in sending sms from pc to mobile through AT commands Pin
Thomas Krojer1-Mar-11 23:33
Thomas Krojer1-Mar-11 23:33 
QuestionAppDomain.CurrentDomain.SetData(SOME_SECRET_KEY, PrivateKey) [modified] Pin
devvvy1-Mar-11 22:53
devvvy1-Mar-11 22:53 
QuestionAssembly.GetExecutingAssembly - can we get "Key" which signed the assembly? Pin
devvvy1-Mar-11 22:49
devvvy1-Mar-11 22:49 
AnswerRe: Assembly.GetExecutingAssembly - can we get "Key" which signed the assembly? Pin
Keith Barrow1-Mar-11 23:23
professionalKeith Barrow1-Mar-11 23:23 
GeneralRe: Assembly.GetExecutingAssembly - can we get "Key" which signed the assembly? [modified] Pin
devvvy2-Mar-11 16:08
devvvy2-Mar-11 16:08 
QuestionHow to block read / write operation of cd/dvd [modified] Pin
Aisha sharma1-Mar-11 22:24
Aisha sharma1-Mar-11 22:24 
AnswerRe: How to block read / write operation of cd/dvd Pin
Keith Barrow1-Mar-11 22:55
professionalKeith Barrow1-Mar-11 22:55 
AnswerRe: How to block read / write operation of cd/dvd Pin
Dalek Dave7-Mar-11 11:22
professionalDalek Dave7-Mar-11 11:22 
QuestionLoad picture from resource file with XAML Pin
Mc_Topaz1-Mar-11 21:25
Mc_Topaz1-Mar-11 21:25 
AnswerRe: Load picture from resource file with XAML Pin
Pete O'Hanlon1-Mar-11 21:31
mvePete O'Hanlon1-Mar-11 21:31 
GeneralRe: Load picture from resource file with XAML Pin
Mc_Topaz1-Mar-11 21:36
Mc_Topaz1-Mar-11 21:36 
AnswerRe: Load picture from resource file with XAML Pin
ltuljo2-Mar-11 14:46
ltuljo2-Mar-11 14:46 
QuestionPostgres database connection Pin
Software20071-Mar-11 9:32
Software20071-Mar-11 9:32 
AnswerRe: Postgres database connection Pin
Orcun Iyigun1-Mar-11 9:38
Orcun Iyigun1-Mar-11 9:38 
GeneralRe: Postgres database connection Pin
Software20071-Mar-11 9:45
Software20071-Mar-11 9:45 
GeneralRe: Postgres database connection Pin
Dave Kreskowiak1-Mar-11 9:46
mveDave Kreskowiak1-Mar-11 9:46 
AnswerRe: Postgres database connection Pin
Dave Kreskowiak1-Mar-11 9:45
mveDave Kreskowiak1-Mar-11 9:45 
Software2007 wrote:
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


Tough. That's the "best practice" method to use.


Software2007 wrote:
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


Bad idea. Database connection licenses are expensive. So, to minimize costs, you are expected to open the connection, use it, then close it as soon as possible so another application can use the connection license on the server.

Think about it. You open a connection for the life of your app, then your app crashes or the network connection goes down, but the SQL connection is never released. Now you've got a connection license being used on the server, but never being used until it's cleared out manually or the connection times out on the server for inactivity.


Software2007 wrote:
How is it normally done in big apps


Open the connection, query it, close it.

GeneralRe: Postgres database connection Pin
Software20071-Mar-11 9:56
Software20071-Mar-11 9:56 
AnswerRe: Postgres database connection Pin
Pete O'Hanlon1-Mar-11 9:56
mvePete O'Hanlon1-Mar-11 9:56 
GeneralRe: Postgres database connection Pin
Software20071-Mar-11 10:26
Software20071-Mar-11 10:26 
GeneralRe: Postgres database connection Pin
Pete O'Hanlon1-Mar-11 10:34
mvePete O'Hanlon1-Mar-11 10:34 
GeneralRe: Postgres database connection Pin
Software20071-Mar-11 10:40
Software20071-Mar-11 10:40 
AnswerRe: Postgres database connection Pin
PIEBALDconsult1-Mar-11 13:55
mvePIEBALDconsult1-Mar-11 13:55 
QuestionFile.Move() method Pin
Orcun Iyigun1-Mar-11 9:30
Orcun Iyigun1-Mar-11 9:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.