From: Elvandar on 23 Oct 2009 08:57
I'm developing an application using VS2005 to deploy on a WM6
device...the application uses a small SqlServer CE database.
The problem is during the connection to this database: I used the
"wizard" in VS2005 to create the database and the DataSet. Then I added
a Table Adapter to create some queries, but I noticed that in the
DataSet.xsd file it puts this connection string:
<Connection ConnectionStringObject="Data Source
Modifier="Assembly" Name="MyAppConnectionString" ParameterPrefix="@"
where the Data Source has its path and filename. The problem is that the
only way to make my app find the database is to put the absolute path to
the .sdf file ("\Program Files\MyApp\MyDB.sdf"). In all other cases it
I should put a relative path to the .sdf file because my app can be
installed both on English and Italian devices, where the Program Files
folder is named "Programmi". I already tried to put
%CSIDL_PROGRAM_FILES%\MyApp\MyDB.sdf as path, but it doesn't work...
Do you have any solution to this problem? I'd like to mantain this
structure created with the wizard, without have to create my
SqlCeConnection objects, etc...
Thanks to all for any answer!
"Grazie, re, per aver accettato di lasciarti vincere soltanto dai tuoi
Veterano di fanteria ad Alessandro Magno, rive del fiume Ifasi, 326 a.C.
From: Rüdiger Kardel on 23 Oct 2009 15:22
Am Fri, 23 Oct 2009 14:57:53 +0200 schrieb Elvandar:
> I should put a relative path to the .sdf file because my app can be
> installed both on English and Italian devices, where the Program Files
> folder is named "Programmi". I already tried to put
> %CSIDL_PROGRAM_FILES%\MyApp\MyDB.sdf as path, but it doesn't work...
should provide you with the required folder name.