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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top