VB style 'with' contruct

  • Thread starter Thread starter Brian Burgess
  • Start date Start date
B

Brian Burgess

Hi all,

Is there a construct in C# that allow multiple operations on an object? ..
Similar to the VB 'WITH'?

Many Thx in Advance..

-BB
 
Brian Burgess said:
Hi all,

Is there a construct in C# that allow multiple operations on an object?
..
Similar to the VB 'WITH'?

Many Thx in Advance..

No.
 
Instead of saying:

with myadapter.selectcommand
...

You could say:

SqlCommand c = myAdapter.SelectCommand;
c.CommandText = "...";
c.etc etc

Don't try it with a value type ;)

John
 
Back
Top