"Best practices" for SQL connections

"Best practices" for SQL connections

Post by David Taylo » Fri, 07 Nov 2003 18:30:11



I am writing a VB.NET program that runs an X-ray analyzer from a PC embedded
in the analyzer.  The program records results of the analysis every 2-3
minutes into a SQL Server database.  In some cases, the SQL Server will be
MSDE on the embedded PC, in other cases it may be another SQL Server on the
LAN.  The analyzers run 24x7.  My question is, given this scenario, what
would you consider "best practice" for handling the SQLConnection object?
Should it be opened continuously? or opened & closed for each write to the
database?

Thanks for any comments/suggestions....

Dave Taylor

 
 
 

"Best practices" for SQL connections

Post by David Brown » Fri, 07 Nov 2003 18:49:25



Quote:> I am writing a VB.NET program that runs an X-ray analyzer from a PC
embedded
> in the analyzer.  The program records results of the analysis every 2-3
> minutes into a SQL Server database.  In some cases, the SQL Server will be
> MSDE on the embedded PC, in other cases it may be another SQL Server on
the
> LAN.  The analyzers run 24x7.  My question is, given this scenario, what
> would you consider "best practice" for handling the SQLConnection object?
> Should it be opened continuously? or opened & closed for each write to the
> database?

If you only need the connection every 2-3 minutes, I would open and close it
each time.
Remember to really close the connection you must supress connection pooling
in the connection string ("Pooling=false").

David

 
 
 

1. "PL/SQL Best Practices" summer series

Catch an excerpt from Tom Kyte's new book "Expert One-on-One Oracle" available
in bookstores this month.

RevealNet's Pipeline Newsletter is featuring a summer-long series of articles on
PL/SQL best practices, with articles from Tom Kyte, Steven Feuerstein and
others. Here's your link to the newsletter:
http://www.revealnet.com/newsletter-v2/newsletter_0601.htm

The Pipeline Newsletter is a free monthly newsletter covering Oracle, DB2 and
SQL Server database technologies. It is an extension of RevealNet's free online
"Pipeline" communities for Oracle and DB2. Join the Pipelines today!
http://www.revealnet.com/Pipelines/pipelines.htm

Best wishes,

Cam White
RevealNet, Inc.

2. ODBC-Error 3146 accessing Money fieldtype

3. Polite and Visual Studio 6

4. Best practice for the "Extraction Process"

5. Does SQL Server provide encryption routines?

6. Best practice for "reverse crosstab"

7. ODBC16 & PARADOX7

8. "Best Practices" ideas

9. WANTED: tempdb "best practices for programmers"

10. RDBMS Column Naming "Best Practice"

11. Help in "good practices"

12. max of ("...","...","..")