Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VB.Net Question
Message
De
12/05/2009 00:02:25
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Divers
Thread ID:
01399325
Message ID:
01399326
Vues:
86
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/
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform