Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Connection string format
Message
De
12/11/2008 17:37:07
 
 
À
08/11/2008 03:27:03
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01360597
Message ID:
01361509
Vues:
16
>>How do you format a connection string path when the data is in a folder under the app_data folder?
>>
>>I have
>>
>><add name="vfpRTP2" connectionString="Provider=VFPOLEDB.1;Data Source=|DataDirectory|2040sharedfiles\2040rtp.dbc" providerName="System.Data.OleDb"/>
>>
>>Which works when I run the form but fails when I configure the datasource.
>>
>>The problem seems to be with the folder delimiters. I have tried several combinations but can't find the right one.
>
>If this is ASP.NET then try checking in code that '|DataDirectory|' is what you think it is:
>string WhereItsLooking = (string)AppDomain.CurrentDomain.GetData("DataDirectory");
>
>Also,by default, the value is stored without a trailing backslash - so you need to add that....

Thanks Viv.
Setting it up like this works.
<add name="vfpRTP2" connectionString="Provider=VFPOLEDB.1;Data Source=|DataDirectory|\2040sharedfiles\2040rtp.dbc" providerName="System.Data.OleDb"/>
(backslash added) however it crashes if you try to go back and edit the data connection with the wizard. I suspect it's just an incompatibility with the driver.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform