Connecting Tech Pros Worldwide Forums | Help | Site Map

with statement

Gunawan
Guest
 
Posts: n/a
#1: Apr 4 '07
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


=?ISO-8859-1?Q?Arne_Vajh=F8j?=
Guest
 
Posts: n/a
#2: Apr 4 '07

re: with statement


Gunawan wrote:
When using vb I could use with statement to make access to
property/method
Quote:
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
Closed Thread