Chris <(E-Mail Removed)> wrote:
> Sorry for the newbie question. I'm passing around a database connection
> into several forms. Do I use byref or byval for the variable, and why?
> To me I should use byref, since I don't want a copy of the connection....
See
http://www.pobox.com/~skeet/csharp/parameters.html
It's about C#, but I believe all the same principles apply to VB.NET.
In short, use ByVal - you're not creating copies of the *object*, just
new references which "point" to the object.
--
Jon Skeet - <(E-Mail Removed)>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too