Click here to Skip to main content
15,916,180 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to Get Data From Data Set Pin
Anubhava Dimri10-Mar-11 1:02
Anubhava Dimri10-Mar-11 1:02 
GeneralRe: How to Get Data From Data Set Pin
Orcun Iyigun10-Mar-11 5:50
Orcun Iyigun10-Mar-11 5:50 
GeneralRe: How to Get Data From Data Set Pin
OriginalGriff10-Mar-11 8:21
mveOriginalGriff10-Mar-11 8:21 
AnswerRe: How to Get Data From Data Set Pin
GauravKP10-Mar-11 0:54
professionalGauravKP10-Mar-11 0:54 
GeneralRe: How to Get Data From Data Set Pin
Anubhava Dimri10-Mar-11 1:02
Anubhava Dimri10-Mar-11 1:02 
QuestionDISPOSE OR CLOSE Pin
Anubhava Dimri9-Mar-11 18:46
Anubhava Dimri9-Mar-11 18:46 
AnswerRe: DISPOSE OR CLOSE Pin
Saksida Bojan9-Mar-11 20:25
Saksida Bojan9-Mar-11 20:25 
AnswerRe: DISPOSE OR CLOSE Pin
OriginalGriff9-Mar-11 21:21
mveOriginalGriff9-Mar-11 21:21 
Dispose. Or (for tidiness) Close and Dispose - though the close is done automatically as part of the dispose.

In preference, enclose your conection and commands in using blocks which will automatically dispose the objects and remove them from scope.
using (SqlConnection con = new SqlConnection(...))
   {
   con.Open();
   using (SqlCommand com = new SqlCommand("SELECT ...", con))
      {
      ...
      }
   }
Closing does not free up all resources associated with the connection until it is disposed, which may take some considerable time if you are waiting for the Garbage Collector to be triggered.

You would normally Close the connection if you will reopen it again soon.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.

Manfred R. Bihy: "Looks as if OP is learning resistant."

GeneralRe: DISPOSE OR CLOSE Pin
Łukasz Nowakowski10-Mar-11 4:20
Łukasz Nowakowski10-Mar-11 4:20 
AnswerRe: DISPOSE OR CLOSE Pin
PIEBALDconsult10-Mar-11 1:52
mvePIEBALDconsult10-Mar-11 1:52 
GeneralRe: DISPOSE OR CLOSE Pin
Anubhava Dimri10-Mar-11 1:54
Anubhava Dimri10-Mar-11 1:54 
AnswerRe: DISPOSE OR CLOSE Pin
jschell10-Mar-11 8:54
jschell10-Mar-11 8:54 
GeneralRe: DISPOSE OR CLOSE Pin
PIEBALDconsult10-Mar-11 13:23
mvePIEBALDconsult10-Mar-11 13:23 
GeneralRe: DISPOSE OR CLOSE Pin
jschell11-Mar-11 9:05
jschell11-Mar-11 9:05 
Questionhow to develop mobile application in c#? [modified] Pin
sairam.bhat9-Mar-11 18:44
sairam.bhat9-Mar-11 18:44 
AnswerRe: who was here? Pin
Anubhava Dimri9-Mar-11 18:49
Anubhava Dimri9-Mar-11 18:49 
AnswerRe: who was here? Pin
RobCroll9-Mar-11 18:52
RobCroll9-Mar-11 18:52 
AnswerRe: how to develop mobile application in c#? Pin
Richard MacCutchan9-Mar-11 22:14
mveRichard MacCutchan9-Mar-11 22:14 
AnswerRe: how to develop mobile application in c#? Pin
_Erik_10-Mar-11 0:58
_Erik_10-Mar-11 0:58 
QuestionCalling a function stored in an SQL data field along with text Pin
Nick Listerman9-Mar-11 16:49
Nick Listerman9-Mar-11 16:49 
AnswerRe: Calling a function stored in an SQL data field along with text Pin
PIEBALDconsult10-Mar-11 1:55
mvePIEBALDconsult10-Mar-11 1:55 
QuestionAccessing DataSet getting error Pin
MAW309-Mar-11 14:57
MAW309-Mar-11 14:57 
Question[Outlook] is It possible to get sender's email address from AppointmentItem? Pin
buffering839-Mar-11 14:53
buffering839-Mar-11 14:53 
AnswerRe: [Outlook] is It possible to get sender's email address from AppointmentItem? Pin
sohail72018-Jul-11 3:29
sohail72018-Jul-11 3:29 
QuestionRandom number generation between a given interval Pin
prakulsol9-Mar-11 6:11
prakulsol9-Mar-11 6: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.