Click here to Skip to main content
15,886,362 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to convert string to form object in c# window application Pin
BillWoodruff11-Aug-13 0:13
professionalBillWoodruff11-Aug-13 0:13 
GeneralRe: How to convert string to form object in c# window application Pin
susanna.floora26-Aug-13 21:47
susanna.floora26-Aug-13 21:47 
QuestionAutocomplete TextBox no find other words in string Pin
juliogyn5-Aug-13 16:49
juliogyn5-Aug-13 16:49 
AnswerRe: Autocomplete TextBox no find other words in string Pin
Abhinav S5-Aug-13 17:07
Abhinav S5-Aug-13 17:07 
GeneralRe: Autocomplete TextBox no find other words in string Pin
juliogyn5-Aug-13 18:08
juliogyn5-Aug-13 18:08 
AnswerRe: Autocomplete TextBox no find other words in string Pin
Abhinav S5-Aug-13 18:31
Abhinav S5-Aug-13 18:31 
GeneralRe: Autocomplete TextBox no find other words in string Pin
juliogyn6-Aug-13 9:18
juliogyn6-Aug-13 9:18 
QuestionTry, Catch, Finally question Pin
JD865-Aug-13 15:15
JD865-Aug-13 15: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 16:45
Abhinav S5-Aug-13 16:45 
GeneralRe: Try, Catch, Finally question Pin
JD866-Aug-13 6:18
JD866-Aug-13 6:18 
AnswerRe: Try, Catch, Finally question Pin
ExcellentOrg5-Aug-13 22:06
ExcellentOrg5-Aug-13 22:06 
AnswerRe: Try, Catch, Finally question Pin
Bernhard Hiller5-Aug-13 22:46
Bernhard Hiller5-Aug-13 22:46 
GeneralRe: Try, Catch, Finally question Pin
JD866-Aug-13 6:18
JD866-Aug-13 6:18 
GeneralRe: Try, Catch, Finally question Pin
Jean A Brandelero8-Aug-13 10:47
Jean A Brandelero8-Aug-13 10:47 
QuestionClick-Once :: Publishing And Updates In Different Locations Pin
Matt U.5-Aug-13 8:17
Matt U.5-Aug-13 8:17 
AnswerRe: Click-Once :: Publishing And Updates In Different Locations Pin
Pete O'Hanlon6-Aug-13 23:05
mvePete O'Hanlon6-Aug-13 23:05 
GeneralRe: Click-Once :: Publishing And Updates In Different Locations Pin
Matt U.7-Aug-13 2:01
Matt U.7-Aug-13 2:01 
QuestionC# Garbage Collection and GC.Collect() Pin
DSLoginYea5-Aug-13 7:38
DSLoginYea5-Aug-13 7:38 
AnswerRe: C# Garbage Collection and GC.Collect() Pin
Eddy Vluggen5-Aug-13 7:51
professionalEddy Vluggen5-Aug-13 7:51 
AnswerRe: C# Garbage Collection and GC.Collect() Pin
Abhinav S5-Aug-13 17:00
Abhinav S5-Aug-13 17:00 
AnswerRe: C# Garbage Collection and GC.Collect() Pin
Bernhard Hiller5-Aug-13 22:49
Bernhard Hiller5-Aug-13 22:49 
QuestionRun Windows project which is set up as a service Pin
vkEE5-Aug-13 2:37
vkEE5-Aug-13 2:37 
AnswerRe: Run Windows project which is set up as a service Pin
Richard MacCutchan5-Aug-13 3:18
mveRichard MacCutchan5-Aug-13 3:18 
AnswerRe: Run Windows project which is set up as a service Pin
Ron Nicholson5-Aug-13 3:39
professionalRon Nicholson5-Aug-13 3:39 
AnswerRe: Run Windows project which is set up as a service Pin
Bernhard Hiller5-Aug-13 22:53
Bernhard Hiller5-Aug-13 22: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.