Thai Tri Hung, For example: You application was executed by user and some period was not used. During user tea-drinking SQL Server has been rebooted by admin and you connection was broken. When user come back: 1. In case of connection pooling this situation would be handled properly. 2. In case only connection you shoud handle connection error and reopen it.
Next example: In multithreaded applications with only connection you must synchronize threads to exclude using of conenction simultaneously. -- Andrey Shvydky > -----Original Message----- > From: Thai Tri Hung [mailto:[EMAIL PROTECTED] > Sent: Monday, March 31, 2003 6:32 AM > To: [EMAIL PROTECTED] > Subject: [ADVANCED-DOTNET] Open Connection - When and how ? > > > Hi , > Thank for reply of Ayyappan Nair and Mark , it's very helpful ! ;> > > And further,Ayyappan Nair ,I see my question in your code , could you > explain to me when could I open a connection . Can I open only one > connection before start my main form (I really want to do that !) and > close it when my app exit. I ask this because in all book I > read , they > always recommend to open a connection on a function and close it when > done , but I think it spends many time to open/close and open/close > again and again. On other hand , I can open only a connection and hold > it during my app run - what's the disadvantage of this way ( > I was read > about connection pooling but it isn't enough to me !) > > > Th�i Tr� H�ng > Software Solution Center > HPT Vietnam Co Ltd > tel : (084) 8.458518 - Ext : 327 > mobile : 0908391763
