Click here to Skip to main content
15,911,891 members
Home / Discussions / C#
   

C#

 
GeneralRe: How know the state connected for udp client Pin
Dave Kreskowiak7-May-15 1:24
mveDave Kreskowiak7-May-15 1:24 
GeneralRe: How know the state connected for udp client Pin
hasan hadi7-May-15 3:17
hasan hadi7-May-15 3:17 
AnswerRe: How know the state connected for udp client Pin
F-ES Sitecore6-May-15 23:28
professionalF-ES Sitecore6-May-15 23:28 
GeneralRe: How know the state connected for udp client Pin
hasan hadi6-May-15 23:35
hasan hadi6-May-15 23:35 
AnswerRe: How know the state connected for udp client Pin
hasan hadi10-May-15 16:12
hasan hadi10-May-15 16:12 
QuestionSQL Server Connection Best Practice Pin
JBHowl6-May-15 8:58
JBHowl6-May-15 8:58 
AnswerRe: SQL Server Connection Best Practice Pin
Richard Deeming6-May-15 9:28
mveRichard Deeming6-May-15 9:28 
AnswerRe: SQL Server Connection Best Practice Pin
Dave Kreskowiak6-May-15 11:11
mveDave Kreskowiak6-May-15 11:11 
Two reasons why you should be creating the connection when you need it and not before the loop.

1) If the connection is broken by something, like a drop in network connectivity, you can recover by creating a new connection inside the loop every time you need it without having to break out of the loop to create a new one.

2) A SQL Server connection seat license ain't cheap. If you had one license to share between multiple applications and users, you'd want your connection to hang on to it for as little time as possible.

Connect as late as you can, run your query, and disconnect as early as you can.
A guide to posting questions on CodeProject

Click this: Asking questions is a skill.
Seriously, do it.

Dave Kreskowiak

AnswerRe: SQL Server Connection Best Practice Pin
F-ES Sitecore6-May-15 22:39
professionalF-ES Sitecore6-May-15 22:39 
QuestionCreating Large, Blank Bitmaps Pin
JBHowl6-May-15 3:39
JBHowl6-May-15 3:39 
AnswerRe: Creating Large, Blank Bitmaps Pin
Dave Kreskowiak6-May-15 4:15
mveDave Kreskowiak6-May-15 4:15 
GeneralRe: Creating Large, Blank Bitmaps Pin
JBHowl6-May-15 4:41
JBHowl6-May-15 4:41 
GeneralRe: Creating Large, Blank Bitmaps Pin
Eddy Vluggen6-May-15 5:14
professionalEddy Vluggen6-May-15 5:14 
GeneralRe: Creating Large, Blank Bitmaps Pin
Dave Kreskowiak6-May-15 11:07
mveDave Kreskowiak6-May-15 11:07 
AnswerRe: Creating Large, Blank Bitmaps Pin
Pete O'Hanlon6-May-15 5:00
mvePete O'Hanlon6-May-15 5:00 
GeneralRe: Creating Large, Blank Bitmaps Pin
JBHowl6-May-15 5:03
JBHowl6-May-15 5:03 
GeneralRe: Creating Large, Blank Bitmaps Pin
Pete O'Hanlon6-May-15 8:50
mvePete O'Hanlon6-May-15 8:50 
AnswerRe: Creating Large, Blank Bitmaps Pin
OriginalGriff6-May-15 6:14
mveOriginalGriff6-May-15 6:14 
GeneralRe: Creating Large, Blank Bitmaps Pin
JBHowl6-May-15 7:16
JBHowl6-May-15 7:16 
QuestionHow can I use webcam in WebBrowser Control? Pin
Member 116126625-May-15 17:45
Member 116126625-May-15 17:45 
AnswerRe: How can I use webcam in WebBrowser Control? Pin
Dr Gadgit6-May-15 2:14
Dr Gadgit6-May-15 2:14 
QuestionC# Get Audio File From Resources Pin
Kevin Marois5-May-15 9:03
professionalKevin Marois5-May-15 9:03 
AnswerRe: C# Get Audio File From Resources Pin
Sascha Lefèvre5-May-15 10:28
professionalSascha Lefèvre5-May-15 10:28 
GeneralRe: C# Get Audio File From Resources Pin
Kevin Marois5-May-15 10:50
professionalKevin Marois5-May-15 10:50 
GeneralRe: C# Get Audio File From Resources Pin
Sascha Lefèvre5-May-15 11:02
professionalSascha Lefèvre5-May-15 11:02 

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.