Click here to Skip to main content
15,904,024 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Problem in using deployed vb.net project Pin
Senthil S21-Dec-07 22:34
Senthil S21-Dec-07 22:34 
GeneralRe: Problem in using deployed vb.net project Pin
DigiOz Multimedia22-Dec-07 6:01
DigiOz Multimedia22-Dec-07 6:01 
Generalcontrol +C and control +V doesn't work on textbox controls. Pin
SekharOne21-Dec-07 20:32
SekharOne21-Dec-07 20:32 
GeneralRe: control +C and control +V doesn't work on textbox controls. Pin
Christian Graus21-Dec-07 21:25
protectorChristian Graus21-Dec-07 21:25 
GeneralRefresh connection or port to Remote DB Pin
nishkarsh_k21-Dec-07 20:10
nishkarsh_k21-Dec-07 20:10 
GeneralRe: Refresh connection or port to Remote DB Pin
Dave Kreskowiak22-Dec-07 4:55
mveDave Kreskowiak22-Dec-07 4:55 
GeneralRe: Refresh connection or port to Remote DB Pin
nishkarsh_k22-Dec-07 20:48
nishkarsh_k22-Dec-07 20:48 
GeneralRe: Refresh connection or port to Remote DB [modified] Pin
Dave Kreskowiak23-Dec-07 4:21
mveDave Kreskowiak23-Dec-07 4:21 
nishkarsh_k wrote:
Yes i am opening the connection once only at start and using through out...


That's a really bad practice. Holding a connection open for the life of your application also holds onto a very expensive SQL Server license, which are usually bought by the seat. This means that, for example, you can have 10 connection licenses on the SQL Server and about 50 machines using them IF they just open a connection for the time it takes to do a query, then close the connection. Using your method, the same server would have to have 50 licenses, at an addition 4 times the cost of 10.

Your database connection is probably, in a normal situation, idle for 99% of it's life. That's a lot of time holding onto a license and dogint nothing with it.

If a customer using your application caught you doing that, you'd probably be fired on the spot.


nishkarsh_k wrote:
My application is based on a DB will it not take a real extra time every time opening and closing the connection???


Nope. The first connection is the most expensive (process wise). Subsequent connections using the same connection string are cached by ADO.NET and open and close very quickly.


A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007




modified on Sunday, December 23, 2007 10:32:46 AM

GeneralPopulate ListView from TreeView Pin
ExcelMonkey21-Dec-07 6:00
ExcelMonkey21-Dec-07 6:00 
GeneralRe: Populate ListView from TreeView Pin
Dave Kreskowiak21-Dec-07 6:12
mveDave Kreskowiak21-Dec-07 6:12 
GeneralMultithreading Problem : Threads die before complete their assigned task Pin
Rupesh Kumar Swami21-Dec-07 2:42
Rupesh Kumar Swami21-Dec-07 2:42 
GeneralRe: Multithreading Problem : Threads die before complete their assigned task Pin
Dave Kreskowiak21-Dec-07 3:10
mveDave Kreskowiak21-Dec-07 3:10 
GeneralRe: Multithreading Problem : Threads die before complete their assigned task Pin
Rupesh Kumar Swami21-Dec-07 4:00
Rupesh Kumar Swami21-Dec-07 4:00 
GeneralRe: Multithreading Problem : Threads die before complete their assigned task Pin
MidwestLimey21-Dec-07 5:15
professionalMidwestLimey21-Dec-07 5:15 
GeneralRe: Multithreading Problem : Threads die before complete their assigned task Pin
Dave Kreskowiak21-Dec-07 6:09
mveDave Kreskowiak21-Dec-07 6:09 
GeneralRe: Multithreading Problem : Threads die before complete their assigned task Pin
MidwestLimey21-Dec-07 6:40
professionalMidwestLimey21-Dec-07 6:40 
Questionwildcard search [modified] Pin
BOREC21-Dec-07 0:43
BOREC21-Dec-07 0:43 
GeneralRe: wildcard search Pin
Dave Kreskowiak21-Dec-07 3:04
mveDave Kreskowiak21-Dec-07 3:04 
GeneralRe: wildcard search Pin
BOREC21-Dec-07 8:33
BOREC21-Dec-07 8:33 
GeneralRe: wildcard search Pin
Dave Kreskowiak21-Dec-07 9:07
mveDave Kreskowiak21-Dec-07 9:07 
GeneralRe: wildcard search Pin
Luc Pattyn21-Dec-07 15:34
sitebuilderLuc Pattyn21-Dec-07 15:34 
GeneralRe: wildcard search Pin
Dave Kreskowiak21-Dec-07 15:52
mveDave Kreskowiak21-Dec-07 15:52 
GeneralRe: wildcard search Pin
Luc Pattyn22-Dec-07 4:18
sitebuilderLuc Pattyn22-Dec-07 4:18 
GeneralRe: wildcard search Pin
ChandraRam23-Dec-07 22:31
ChandraRam23-Dec-07 22:31 
QuestionHow to add shape controls to pictuirebox in vb.net Pin
VB 8.021-Dec-07 0:36
VB 8.021-Dec-07 0:36 

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.