Re: Help With Basic Windows Mobile App



Using managed code, the compactframework newsgroup would be your best source of information.

--

Ginny Caughey
Device Application Development MVP


"FlyFishGuy" <FlyFishGuy@xxxxxxxxxxxxx> wrote in message news:u1A2tS8YJHA.1272@xxxxxxxxxxxxxxxxxxxxxxx
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








.



Relevant Pages

  • Re: Help With Basic Windows Mobile App
    ... "\MilkMonitor.sdf" to find the file in the same folder as the app, ... Private Const DB_CONNECTION_STRING As String = "Data ... 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. ...
    (microsoft.public.sqlserver.ce)
  • Re: Help With Basic Windows Mobile App
    ... If your app folder is Program ... I've since inspected the app directory on the emulator. ... read where I should be manually copying the sdf file, ...
    (microsoft.public.sqlserver.ce)
  • Re: Help With Basic Windows Mobile App
    ... I've since inspected the app directory on the emulator. ... The sdf file is set to Build ... puttimg 'Mobile Device' in the path, using '|DataDirectory|', etc. I've ...
    (microsoft.public.sqlserver.ce)
  • Re: Having to restart the emulator
    ... Stuart Celarier, Fern Creek ... Having to restart the emulator ... Can you confirm if there is a sentence "share violation" shown ... >I am pretty certain that I use to launch the emulator for a PPC app by ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: EVB3 debugging doesnt start on PocketPC2002 emulator
    ... >What exactly do you mean by "putting your app in the root directory"? ... >> putting my app in the root directory/folder even if I normally install ... >>>Pocket PC 2002 emulator connection problems on my PC ... >>>After this first successful emulator connection using EVC, ...
    (microsoft.public.pocketpc)