Re: Database for a WM5 device



Peter,

Thanks for your help. I think I have finally figured it out, after 2 days
of total frustration.

You suggestion of the single quotes wasn't it. What seems to be happening
is that VS2003 is not recognizing Windows Mobile 5 and therefore not
installing any of the needed SQL CE CAB files. (I'm assuming that during a
'Deploy' it should be doing this automatically....right??)

So what I did was copy the needed CAB files from "C:\Program Files\Microsoft
Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows
CE\wce400\armv4", and then run them on my WM5 device.

After doing that I am able to run my SQL CE commands in my VB.NET program
without any difficulties.

Such a simple solution for an annoyance in VS2003. I can't believe I
couldn't find anything on the MS site about that.

That being said, I thank you for all your help. I am pretty much a 'novice'
programmer, so I'm learning so much just going on my own and trying to figure
stuff out.

Ultimately, do you think using SQL CE is the best option for an app that
needs to use a DB on the PocketPC?? Currently I just need the DB to store,
retrieve and update data that is used in my app. No plans on bringing the
data back to the desktop, but if I did want to do that, will SQL CE be the
right choice?

I just ordered the WM5 Developer Kit from MS which has a demo of VS2005,
etc. Would SQL Mobile be any better??

Thanks,

Brian

"Peter Foot [MVP]" wrote:

With VS2003 you already have the necessary SQLCE components required - these
will be deployed to the device as required when you debug (once you add a
reference to System.Data.SqlServerCE). What specific Exception is thrown, if
you get the full details from this - error codes, message etc it will help
determine the cause.

Check your connection string - I believe the database path should be
surrounded with single quotes e.g. "Data Source='\Test.sdf'"

Peter

--
Peter Foot
Windows Embedded MVP
www.peterfoot.net | www.inthehand.com

"brianbulla@xxxxxxxxxxx" <brianbullahotmailcom@xxxxxxxxxxxxxxxxxxxxxxxxx>
wrote in message news:E92A1220-B9C9-45A5-964A-4308D99D3FBD@xxxxxxxxxxxxxxxx
Peter,

Thanks for the help. I'm still a little confused, so hopefully you can
clarify.

It sounds like I can use SQL CE on my WM5 device. Currently I only need
the
DB to reside on the device. Assuming that I have added all the proper
references and installed SQL Server CE on my desktop, should these two
lines
of code work??

dim engine as New SqlCEEngine("Data Source = test.sdf")
engine.CreateDatabase()

From everything I have read, this should create a test.sdf file on my PPC,
which I can then issue other commands against in my code. However, the
.CreateDatabase line is generating an exception and I cannot figure out
why.
I have found plenty of other posts on the WWW with this same problem, but
not
a single one has a solution for this.

Do you think it is my configuration?? Again, I am using VS.NET 2003,
CF1.1
and a WM5 device.

After downloading and running the setup for SQL CE from the Microsoft
website is there any further I need to do??

This problem is driving me nuts!!

Your help is appreciated,

Brian



"Peter Foot [MVP]" wrote:

SQL CE will work on WM5 and older Pocket PCs. However you can't create a
SQL
CE database on the desktop (without third-party tools). SQL Mobile has
tools
within VS2005 to support creating your database on the desktop, to use
SQL
Mobile you need .NETCF v2.0 so this is only an option for PPC2003 and
newer.

Peter

--
Peter Foot
Windows Embedded MVP
www.peterfoot.net | www.inthehand.com

"brianbulla@xxxxxxxxxxx"
<brianbulla@xxxxxxxxxxx@discussions.microsoft.com>
wrote in message
news:D06C5E68-7A1A-42E3-AD86-38ABAF95F386@xxxxxxxxxxxxxxxx
Hello,

I need a database for my WM5 app. I am using VS.NET 2003. I would
like
to
use ADO style access to the database.

I noticed on my old PPC 2002 device that I could upload .mdb file to
and
they would automatically be converted to .cdb. With WM5 this is no
longer
possible due to the lack of Pocket Access.

Therefore, how do I build a database for my WM5 device?? Do I need to
upgrade to VS.NET 2005??

I tried installing SQL Server CE onto my desktop and then using the
'engine.createdatabase' method to create an .sdf file, but that
generated
an
exception.

I am at a loss trying to figure this out. I thought it would be
simple.

Any help is appreciated.

Thanks,

Brian






.



Relevant Pages

  • Re: Database for a WM5 device
    ... It sounds like I can use SQL CE on my WM5 device. ... .CreateDatabase line is generating an exception and I cannot figure out ... CE database on the desktop. ...
    (microsoft.public.pocketpc.developer)
  • Re: Need a Strategy to store the Single Quotes in the Database
    ... >> Database where if i try to Store the String value with Single Quotes ... >> then it is throwing the error as SQL String Truncated. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Database for a WM5 device
    ... It sounds like I can use SQL CE on my WM5 device. ... CE database on the desktop. ... I noticed on my old PPC 2002 device that I could upload .mdb file to and ...
    (microsoft.public.pocketpc.developer)
  • Re: Need a Strategy to store the Single Quotes in the Database
    ... Database where if i try to Store the String value with Single Quotes then it is throwing the error as SQL String Truncated. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: SQL Question
    ... This will go through since the single quotes are passed on literally ... to the database while the double ... part of format function will be resolved by VB... ... The first and third DatePart are being passed to SQL; ...
    (microsoft.public.vb.general.discussion)