Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VB.Net Question
Message
From
12/05/2009 00:02:25
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Miscellaneous
Thread ID:
01399325
Message ID:
01399326
Views:
85
This message has been marked as the solution to the initial question of the thread.
>What is the difference between these two lines of code?
>
>
>Dim MyConnection As New SqlConnection()
>Dim RetVal As SqlConnection = New SqlConnection()
>
One variable name is MyConnection, and the other is RetVal. And that's it. The first line is a VB.NET shortcut. Some developers prefer to instantiate their object immediately, and some prefer to declare their variable and instantiate the object in a Try Catch block. It's a matter of style.
Very fitting: http://xkcd.com/386/
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform