Re: Help With Basic Windows Mobile App
- From: "FlyFishGuy" <FlyFishGuy@xxxxxxxxxxxxx>
- Date: Sun, 21 Dec 2008 18:34:28 -0500
Thanks Ginny, that's exactly what I needed. I've searched everywhere for
this and I'm surprised it has been so elusive.
As it turns out, this was more of a Mobile Device question than a CE
question. I just started looking at this group (I've seen your posts) and
from your sig, it appears that you could direct me to answers to other
questions I have. I'm appreciative of your help and I don't like scope
creep, but I'm having issues with my 6.0 Pro Emulator (Classic works fine).
It's totally FUBAR. Can you tell me the best group to post these questions
to?
Thanks so much.
"Ginny Caughey MVP" <ginny.caughey.online@xxxxxxxxxxxxxx> wrote in message
news:7FB70A18-C905-4EB8-8792-B7D65225FCDA@xxxxxxxxxxxxxxxx
FlyFishGuy,
There is no such thing as a current directory in CE, so the first one
would reference the root - not what you want. There is no c: on CE either
so the last one won't work either. If your app folder is Program
Files\MilkMonitor, I'd expect "Data Source=Program
Files\MilkMonitor\MilkMonitor.sdf" to work. Or use this:
System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)
+ "\MilkMonitor.sdf" to find the file in the same folder as the app,
wherever that might be.
--
Ginny Caughey
Device Application Development MVP
"FlyFishGuy" <FlyFishGuy@xxxxxxxxxxxxx> wrote in message
news:%23bmcaM5YJHA.4072@xxxxxxxxxxxxxxxxxxxxxxx
That's what I can't seem to get right. I've tried many variations, each
with and without a space between 'Data' and 'Source', also with single
and double slashes. Here are just a few of them...
Private Const DB_CONNECTION_STRING As String = "Data
Source=MilkMonitor.sdf"
Private Const DB_CONNECTION_STRING As String = "Data
Source=|DataDirectory|\MilkMonitor.sdf"
Private Const DB_CONNECTION_STRING As String = "Data Source=My
Device\Program Files\MilkMonitor\MilkMonitor.sdf"
Private Const DB_CONNECTION_STRING As String = "Data Source=Mobile
Device\Program Files\MilkMonitor\\MilkMonitor.sdf"
Private Const DB_CONNECTION_STRING As String = "Data Source=c:\Program
Files\MilkMonitor\MilkMonitor.sdf"
Also, I've since inspected the app directory on the emulator. The sdf
file is there in the app folder, so I know it got deployed, but the
application just doesn't see it, even if I execute the deployed app
directly from the emulator and not in VS debug mode. Given that the sdf
is in the app folder, I would expect that the first one listed here would
work.
The error message (using example #1) is... The database file cannot be
found. Check the path to the database. [ Data Source = MilkMonitor.sdf ]
BTW... example #2 is what I've always used for a CE desktop (winforms)
application, with no issues.
Thanks
"Pete Vickers" <pete@xxxxxxxxxxxxxxxxxxx> wrote in message
news:4460F074-182B-4047-897A-BCA067894216@xxxxxxxxxxxxxxxx
What is your connection string?
"FlyFishGuy" <FlyFishGuy@xxxxxxxxxxxxx> wrote in message
news:OueInWsYJHA.5156@xxxxxxxxxxxxxxxxxxxxxxx
This is my first attempt to create a simple mobile app, with db access,
but I'm having issues and I can't seem to find any (accurate) info on
the problems.
I'm using, VS2008 SP1, SQL CE 3.5, WinMobile Pro SDK 6.0, ActiveSync
4.5.
First, my app will only run using the 'Classic' emulator. I have MANY
goofy exceptions when trying to use the 'Professional' emulator. I know
that's not an SQL CE issue, but I thought I'd throw it in also in case
someone else has seen the same issue.
Regarding SQL CE, I have yet to connect to my DB. I always get the 'the
path is not valid' error using the emulator. The sdf file is set to
Build Action=Content and the Copy To Output Dir= Copy Always. I've seen
many suggestions for this error like using double backslashes in the
path, puttimg 'Mobile Device' in the path, using '|DataDirectory|',
etc. I've tried everything I have read, but no connection. I've also
read where I should be manually copying the sdf file, but how? The
emulator does not show up in the 'Mobile Devices' on the PC. I'm lost.
My first thought is that if something so simple is so difficult to
figure out and there is no (findable useable) documentation on this
then I should wait until the technology matures to the point that it
works out-of-the-box, but I would like to get this working if anyone
can provide some clarity on this.
Thanks
.
- Follow-Ups:
- Re: Help With Basic Windows Mobile App
- From: Ginny Caughey MVP
- Re: Help With Basic Windows Mobile App
- References:
- Help With Basic Windows Mobile App
- From: FlyFishGuy
- Re: Help With Basic Windows Mobile App
- From: Pete Vickers
- Re: Help With Basic Windows Mobile App
- From: FlyFishGuy
- Re: Help With Basic Windows Mobile App
- From: Ginny Caughey MVP
- Help With Basic Windows Mobile App
- Prev by Date: Re: Help With Basic Windows Mobile App
- Next by Date: Re: Help With Basic Windows Mobile App
- Previous by thread: Re: Help With Basic Windows Mobile App
- Next by thread: Re: Help With Basic Windows Mobile App
- Index(es):
Relevant Pages
|
Loading