Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Conditional object dimension
Message
De
18/02/2003 17:30:59
 
 
À
18/02/2003 15:56:31
Rex Mahel
Realm Software, Llc
Ohio, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00754495
Message ID:
00754698
Vues:
26
I agree with Bonnie. Create two data access components and use whichever is appropriate for the datasource that you're accessing.

-Mike

>Mike,
>
>Is there a way to do what I am trying to do in my original example? I want to be able to use either the OleDb or Oracle provider.
>
>
>Dim strProvider As String = "OracleClient"
>
>If strProvider = "OracleClient"
>	Dim ConPubs As New OracleConnection(odh)
>Else
>	Dim ConPubs As New OleDbConnection(odh)
>End If
>
>ConPubs.Open()
>
>
>Thanks
>
>Rex
>
>
>>Declare the variable outside the If
>>
>>OracleConnection myConnection;
>>OracleCommand myCommand;
>>if () {
>>}
>>
>>The compiler is probably throwing the error because it can't guarantee that the object is created. It's also possible that the variable no longer exists since it was declared within the scope of the IF. I'm not completely sure if VB.Net behaves this way or not.
>>
>>-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform