|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Doing "using" with CodeDom?Is there any way to do "using" with the CodeDom?
using(SqlConnection connnection = new SqlConnection("...")) { } Kevin On Apr 26, 5:18 pm, Kevin Burton
<KevinBur***@discussions.microsoft.com> wrote: > Is there any way to do "using" with the CodeDom? No, because using is a language specific facility. You'll have to go> > using(SqlConnection connnection = new SqlConnection("...")) > { > > } > > Kevin the long way around and do: SQLConnection connection = new SqlConnection("..."); try { } finally { connection.Dispose(); } which is the equivalent. I'm a VBer, and face similar hurdles with SyncLock and While (both of which *do* have equivalents in C#, but are somehow ommitted from the CodeDOM) Damien |
|||||||||||||||||||||||