Click here to Skip to main content
15,569,319 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to convert string to form object in c# window application Pin
BillWoodruff11-Aug-13 1:13
professionalBillWoodruff11-Aug-13 1:13 
GeneralRe: How to convert string to form object in c# window application Pin
susanna.floora26-Aug-13 22:47
susanna.floora26-Aug-13 22:47 
QuestionAutocomplete TextBox no find other words in string Pin
juliogyn5-Aug-13 17:49
juliogyn5-Aug-13 17:49 
AnswerRe: Autocomplete TextBox no find other words in string Pin
Abhinav S5-Aug-13 18:07
Abhinav S5-Aug-13 18:07 
GeneralRe: Autocomplete TextBox no find other words in string Pin
juliogyn5-Aug-13 19:08
juliogyn5-Aug-13 19:08 
AnswerRe: Autocomplete TextBox no find other words in string Pin
Abhinav S5-Aug-13 19:31
Abhinav S5-Aug-13 19:31 
GeneralRe: Autocomplete TextBox no find other words in string Pin
juliogyn6-Aug-13 10:18
juliogyn6-Aug-13 10:18 
QuestionTry, Catch, Finally question Pin
JD865-Aug-13 16:15
JD865-Aug-13 16:15 
I'm writing some DLL's and have a question.

If I throw the exception in the catch block does the finally ever execute? Reason why I am doing this is because the DLL's do not perform logging, the calling class does. But I need to make sure I dispose of my objects.

Example:

C#
SqlConnection conn = null;
SqlCommand cmd = null;

try
{
}
catch (Exception ex)
{
throw;
}
finally
{
if (cmd != null)
cmd.Dispose();

if (conn != null)
conn.Dispose();
}


IS that proper or should I dispose in the catch block AND the finally block because the finally will never execute since i'm rethrowing the exception?
AnswerRe: Try, Catch, Finally question Pin
Abhinav S5-Aug-13 17:45
Abhinav S5-Aug-13 17:45 
GeneralRe: Try, Catch, Finally question Pin
JD866-Aug-13 7:18
JD866-Aug-13 7:18 
AnswerRe: Try, Catch, Finally question Pin
ExcellentOrg5-Aug-13 23:06
ExcellentOrg5-Aug-13 23:06 
AnswerRe: Try, Catch, Finally question Pin
Bernhard Hiller5-Aug-13 23:46
Bernhard Hiller5-Aug-13 23:46 
GeneralRe: Try, Catch, Finally question Pin
JD866-Aug-13 7:18
JD866-Aug-13 7:18 
GeneralRe: Try, Catch, Finally question Pin
Jean A Brandelero8-Aug-13 11:47
Jean A Brandelero8-Aug-13 11:47 
QuestionClick-Once :: Publishing And Updates In Different Locations Pin
Matt U.5-Aug-13 9:17
Matt U.5-Aug-13 9:17 
AnswerRe: Click-Once :: Publishing And Updates In Different Locations Pin
Pete O'Hanlon7-Aug-13 0:05
mvaPete O'Hanlon7-Aug-13 0:05 
GeneralRe: Click-Once :: Publishing And Updates In Different Locations Pin
Matt U.7-Aug-13 3:01
Matt U.7-Aug-13 3:01 
QuestionC# Garbage Collection and GC.Collect() Pin
DSLoginYea5-Aug-13 8:38
DSLoginYea5-Aug-13 8:38 
AnswerRe: C# Garbage Collection and GC.Collect() Pin
Eddy Vluggen5-Aug-13 8:51
professionalEddy Vluggen5-Aug-13 8:51 
AnswerRe: C# Garbage Collection and GC.Collect() Pin
Abhinav S5-Aug-13 18:00
Abhinav S5-Aug-13 18:00 
AnswerRe: C# Garbage Collection and GC.Collect() Pin
Bernhard Hiller5-Aug-13 23:49
Bernhard Hiller5-Aug-13 23:49 
QuestionRun Windows project which is set up as a service Pin
vkEE5-Aug-13 3:37
vkEE5-Aug-13 3:37 
AnswerRe: Run Windows project which is set up as a service Pin
Richard MacCutchan5-Aug-13 4:18
mveRichard MacCutchan5-Aug-13 4:18 
AnswerRe: Run Windows project which is set up as a service Pin
Ron Nicholson5-Aug-13 4:39
professionalRon Nicholson5-Aug-13 4:39 
AnswerRe: Run Windows project which is set up as a service Pin
Bernhard Hiller5-Aug-13 23:53
Bernhard Hiller5-Aug-13 23:53 

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.