Hi all,
I wanted to have the genereic |DataDirectory| token in the
connection string so that at deployment time I do not need
to know where the application is. When debugging, I saw in text visualizer
that my connection string was :
Data Source = |DataDirectory|\MyDB.sdf;
which I though it was Ok. However, I got the exception:
The path is not valid. Check the directory for the database. [ Path =
|DataDirectory|\MyDB.sdf ]
What did I do wrong?
Thanks for any help.
Carlos.
Simon Hart [MVP] - 09 Aug 2008 19:26 GMT
I don't know what you mean by |DataDirectory| token but usually for this
kind of thing you'd use the special folder constants within the framework.
This is true for devices as well as desktop operating systems.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://www.simonrhart.com
> Hi all,
>
[quoted text clipped - 15 lines]
>
> Carlos.
Laxmi Narsimha Rao Oruganti [MSFT] - 13 Aug 2008 12:54 GMT
1) |DataDirectory| is not supported on .NET CF. It is available only on .NET FX.
2) Read this thread for more details.
Thanks,
Laxmi
>I don't know what you mean by |DataDirectory| token but usually for this
> kind of thing you'd use the special folder constants within the framework.
[quoted text clipped - 23 lines]
>>
>> Carlos.