Hi Mike,
There're two kinds of types in .NET world, i.e. value type and reference
type.
A value-type variable contains its data directly as opposed to a
reference-type variable, which contains a reference to its data. Therefore,
passing a value-type variable to a method means passing a copy of the
variable to the method. Any changes to the parameter that take place inside
the method have no effect on the original data stored in the variable.
If you want the called method to change the value of the parameter, you
have to pass it by reference, using the ref or out keyword.
A variable of a reference type does not contain its data directly; it
contains a reference to its data. When you pass a reference-type parameter
by value, it is possible to change the data pointed to by the reference,
such as the value of a class member. However, you cannot change the value
of the reference itself; that is, you cannot use the same reference to
allocate memory for a new class and have it persist outside the block. To
do that, pass the parameter using the ref or out keyword.
In your practice, both the DataSet and WebService types are of reference
type. If you don't intend to change the values of the reference themselves,
you needn't use the ref keyword.
In addition, you may place the DataSet and WebService objects at the root
level for the duration of the application, to enable them to be used for
many other calls in the application.
Hope this helps.
If you have anything unclear, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.