Click here to Skip to main content
16,015,023 members
Home / Discussions / C#
   

C#

 
QuestionRe: Is there any Container Control to Load a Form in it ? Pin
SepantaNima16-Nov-10 1:57
SepantaNima16-Nov-10 1:57 
AnswerRe: Is there any Container Control to Load a Form in it ? Pin
Luc Pattyn16-Nov-10 4:05
sitebuilderLuc Pattyn16-Nov-10 4:05 
GeneralRe: Is there any Container Control to Load a Form in it ? Pin
SepantaNima16-Nov-10 4:09
SepantaNima16-Nov-10 4:09 
Questionwhen is finally?! Pin
Jassim Rahma14-Nov-10 4:36
Jassim Rahma14-Nov-10 4:36 
AnswerRe: when is finally?! Pin
dan!sh 14-Nov-10 5:10
professional dan!sh 14-Nov-10 5:10 
GeneralRe: when is finally?! Pin
Pete O'Hanlon14-Nov-10 9:00
mvePete O'Hanlon14-Nov-10 9:00 
GeneralRe: when is finally?! Pin
PIEBALDconsult14-Nov-10 11:30
mvePIEBALDconsult14-Nov-10 11:30 
AnswerRe: when is finally?! Pin
Henry Minute14-Nov-10 5:23
Henry Minute14-Nov-10 5:23 
As d@nish has said the finally block takes care of them.

However, as both of the classes implement IDisposable, you should consider using the using construct which would mean that you will not need the Finally block.

C#
using (SqlConnection myConnection = new SqlConnection(...............))
{
  ...............................
  ...............................
  ...............................
  myConnection.whatever = ?????
  try
  {
    ...............................
    ...............................
    ...............................
    using (SqlDataReader myReader = new SqlDataReader(.......))
    {
       while (myReader.Read())
       {
          ...............................
          ...............................
       }
    }
  }
  catch (....)
  {
    ...............................
  }
}


The using[^] construct guarantees disposal.
Henry Minute

Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”

AnswerRe: when is finally?! Pin
Luc Pattyn14-Nov-10 7:08
sitebuilderLuc Pattyn14-Nov-10 7:08 
GeneralRe: when is finally?! Pin
Henry Minute14-Nov-10 7:54
Henry Minute14-Nov-10 7:54 
GeneralRe: when is finally?! Pin
Jacob D Dixon14-Nov-10 14:09
Jacob D Dixon14-Nov-10 14:09 
GeneralRe: when is finally?! [modified] Pin
Henry Minute14-Nov-10 14:20
Henry Minute14-Nov-10 14:20 
GeneralRe: when is finally?! Pin
Jeff Connelly15-Nov-10 4:38
Jeff Connelly15-Nov-10 4:38 
GeneralRe: when is finally?! Pin
Jacob D Dixon15-Nov-10 10:34
Jacob D Dixon15-Nov-10 10:34 
GeneralRe: when is finally?! Pin
Jeff Connelly15-Nov-10 10:49
Jeff Connelly15-Nov-10 10:49 
Questionpixel related question Pin
inayathussaintoori13-Nov-10 4:48
inayathussaintoori13-Nov-10 4:48 
AnswerRe: pixel related question Pin
Abhinav S13-Nov-10 7:01
Abhinav S13-Nov-10 7:01 
GeneralRe: pixel related question Pin
inayathussaintoori13-Nov-10 7:15
inayathussaintoori13-Nov-10 7:15 
QuestionPlay multiple sounds with SoundPlayer and SDK DirectSound Pin
Mc_Topaz13-Nov-10 0:57
Mc_Topaz13-Nov-10 0:57 
Questiongiving authorization to the user Pin
Erdinc2712-Nov-10 23:55
Erdinc2712-Nov-10 23:55 
AnswerRe: giving authorization to the user Pin
Eddy Vluggen13-Nov-10 9:01
professionalEddy Vluggen13-Nov-10 9:01 
GeneralRe: giving authorization to the user Pin
Erdinc2713-Nov-10 9:50
Erdinc2713-Nov-10 9:50 
GeneralRe: giving authorization to the user Pin
Eddy Vluggen13-Nov-10 11:21
professionalEddy Vluggen13-Nov-10 11:21 
QuestionSkins Pin
Anil Kumar.Arvapalli12-Nov-10 18:45
Anil Kumar.Arvapalli12-Nov-10 18:45 
AnswerRe: Skins Pin
thatraja12-Nov-10 19:11
professionalthatraja12-Nov-10 19:11 

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.