with statement

  • Thread starter Thread starter Gunawan
  • Start date Start date
G

Gunawan

Hi All,
When using vb I could use with statement to make access to property/method
shorter

Dim cmd AS new SqlCommand
with cmd.parameters
.AddWithValue()
....
end with

Do we have similar function/statement in CSharp?

Regards,
Gun
 
Gunawan wrote:
When using vb I could use with statement to make access to
property/method
shorter

Dim cmd AS new SqlCommand
with cmd.parameters
.AddWithValue()
...
end with

Do we have similar function/statement in CSharp?

No.

Lot of people mis it, but C# is in the C++/Java family for good and
for worse.

Arne
 

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