August 2004 - Posts

How to keep a local variable in scope across a try and catch block?
12 August 04 06:33 PM
The following code won't work, because conn goes out of scope before you enter the catch block. try { Connection conn = new Connection(); conn.Open(); } catch { if (conn != null ) conn.Close(); } The fix is simple - just declare conn before entering the Read More...
Does C# support variable arguments (vararg's) on methods?
05 August 04 05:00 PM
There was a suggestion/question on the Product Feedback site for VS2005 that suggested that the params keyword may not be that well understood. The params keyword can be applied on a method parameter that is an array. When the method is invoked, the elements Read More...
Postedby CSharpFAQ | 4 Comments    
What is the equivalent to regsvr32 in .NET?
02 August 04 02:15 PM
Where you once used Regsvr32 on unmanaged COM libraries, you will now use Regasm on managed .NET libraries. “ Regsvr32 is the command-line tool that registers .dll files as command components in the registry“ “Regasm.exe, the Assembly Read More...
Postedby CSharpFAQ | 9 Comments    
Filed under:

This Blog

Syndication

Page view tracker