Click here to Skip to main content
15,906,645 members
Home / Discussions / Database
   

Database

 
QuestionExporting and Import DTS packages? Pin
devvvy14-Dec-06 21:08
devvvy14-Dec-06 21:08 
AnswerRe: Exporting and Import DTS packages? Pin
Frank Kerrigan14-Dec-06 23:48
Frank Kerrigan14-Dec-06 23:48 
GeneralRe: Exporting and Import DTS packages? Pin
devvvy16-Dec-06 15:37
devvvy16-Dec-06 15:37 
QuestionCursor and set , execute Statement related Query Pin
param thaker14-Dec-06 19:47
param thaker14-Dec-06 19:47 
AnswerRe: Cursor and set , execute Statement related Query Pin
Frank Kerrigan14-Dec-06 23:54
Frank Kerrigan14-Dec-06 23:54 
QuestionOpening and Closing Conneciton for a loop Pin
Amrish Deep14-Dec-06 17:05
Amrish Deep14-Dec-06 17:05 
AnswerRe: Opening and Closing Conneciton for a loop Pin
Paul Conrad14-Dec-06 18:12
professionalPaul Conrad14-Dec-06 18:12 
AnswerRe: Opening and Closing Conneciton for a loop Pin
coolestCoder14-Dec-06 19:01
coolestCoder14-Dec-06 19:01 
Hi,
It would be better if you open connection before the For loop and close when complete for loop is executed, as suggested by the other poster. But i would like to add that use try catch blocks for opening connections and executing queries. If any exception is thrown it would be handled then.
Also remember to close the connection in the finally block of the try catch statement. This is important since the finally block gets executed regardless of an error. For example, do something like this ....

declare connection here
Try
instantiate connection here
open connection
for loop starts here
statements in loop
for loop ends here
catch ex as Exception
any error handling goes here
finally
close and dispose connection here
end try


Hope i am clear enough.




"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder

coolestCoder

QuestionAdding a new row Pin
goldoche14-Dec-06 5:59
goldoche14-Dec-06 5:59 
AnswerRe: Adding a new row Pin
Karma3125114-Dec-06 10:12
Karma3125114-Dec-06 10:12 
Questionhi Pin
Tauseef A14-Dec-06 1:01
Tauseef A14-Dec-06 1:01 
AnswerRe: hi Pin
Colin Angus Mackay14-Dec-06 1:43
Colin Angus Mackay14-Dec-06 1:43 
AnswerRe: hi Pin
Frank Kerrigan14-Dec-06 3:30
Frank Kerrigan14-Dec-06 3:30 
GeneralRe: hi Pin
Tauseef A14-Dec-06 9:37
Tauseef A14-Dec-06 9:37 
GeneralRe: hi Pin
Colin Angus Mackay14-Dec-06 13:31
Colin Angus Mackay14-Dec-06 13:31 
QuestionRe: hi Pin
Tauseef A14-Dec-06 19:35
Tauseef A14-Dec-06 19:35 
AnswerRe: hi Pin
Frank Kerrigan14-Dec-06 23:55
Frank Kerrigan14-Dec-06 23:55 
GeneralRe: hi Pin
Tauseef A15-Dec-06 6:31
Tauseef A15-Dec-06 6:31 
GeneralRe: hi Pin
Private_Void15-Dec-06 7:19
Private_Void15-Dec-06 7:19 
AnswerRe: hi Pin
S Douglas17-Dec-06 23:20
professionalS Douglas17-Dec-06 23:20 
QuestionExtended SP (CLRSP) in .net Pin
om474113-Dec-06 23:39
om474113-Dec-06 23:39 
QuestionRestoring a database problem - database in use Pin
steve_rm13-Dec-06 15:50
steve_rm13-Dec-06 15:50 
AnswerRe: Restoring a database problem - database in use Pin
Andy Brummer13-Dec-06 17:39
sitebuilderAndy Brummer13-Dec-06 17:39 
QuestionRe: Restoring a database problem - database in use Pin
steve_rm13-Dec-06 18:45
steve_rm13-Dec-06 18:45 
AnswerRe: Restoring a database problem - database in use Pin
Andy Brummer13-Dec-06 18:48
sitebuilderAndy Brummer13-Dec-06 18:48 

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.