Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Access connection string on hosted server
Message
De
06/07/2007 13:20:50
 
 
À
06/07/2007 13:11:45
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01237935
Message ID:
01238282
Vues:
8
>Clearly being an XML file causes the issues here, but what might be the proper syntax for getting this within an xml file?

Good question. Have you tried:
<add key="SWHT\Connection" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="~/App_Data/SWHT.mdb" />
No clue if that will work, just a SWAG.

~~Bonnie




>Hi Bonnie,
>
>Ok I put this in the web.config file
>
><add key="SWHT\Connection" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_Data/SWHT.mdb") />
>
>
>I get the following errors:
>
>Data Source="    Missing required white space
>+                Character '+' hexidecimal value 0x2b is illegal in an XML name
>("~/App_Data/SWHT.mdb")  Character '(' same as above
>/ inside the path causes - Expecting '/>'
>
>Clearly being an XML file causes the issues here, but what might be the proper syntax for getting this within an xml file?
>
>>
>>"Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Server.MapPath("~/App_Data/ASPNetDB.mdb")
>>
>>
>>
>>~~Bonnie
>>
>>
>>
>>
>>>I am getting desperate. I have deployed this website 5 times last night trying to get a connection string to work for access. I can do it fine on my development machine because I use the full path to the file. On the web server I don't know what this is. If someone could help it would be greatly appreciated.
>>>
>>>I am placing my data file in App_Data under the root. How do I create a connections string that maps to that location?
>>>
>>>Tim
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform