A little help on the process of app/db creation

J

Jon

As I understand it, right now the only way to create tables/databases on SQL
CE is through code. When I install my app to a new user, it will need to
create its database and insert any default data. I obviously must do this
in my apps code. One way I thought of to do this was to make a registry
setting and set it to 0 if the table creation code had not been run and 1 if
it had. On app startup, it would check this and if it were 0, it would
create the db/tables and insert the default data. Otherwise, it would
continue without running that portion of the code. Is this a good way to do
it? I'd like to know how some others are doing it? Or if I'm
misunderstanding the process of CF/SQL CE development altogether, can you
fill me in on the correct methodology?

Thanks!
 
M

marcmc

two options:
1. build xml schema and populate through writing xml.

2.
buils database once then replicate from SQLServer

Try
If Not File.Exists(datasource) Then
rep.AddSubscription
(AddOption.CreateDatabase)
Else
rep.ReinitializeSubscription(False)
End If
Catch ex As SqlCeException
DisplaySQLCEErrors(ex)
Return 1
End Try
 
A

Alex Yakhnin [MVP]

You can also pre-create the database on the device or
emulator, copy it on the desktop and use it for
distribution to users.
 
J

Jon

So, the database is a single file that can simply be copied from one device
to another as long as SQL CE is installed?

Thanks
 
A

Alex Yakhnin [MVP]

Yes, that's correct.

-Alex
-----Original Message-----
So, the database is a single file that can simply be copied from one device
to another as long as SQL CE is installed?

Thanks





.
 
J

Jim

The Process I am using is twofold.
I have a simple CF app that I use to create my database here at corporate.
That "Blank" database as we refer to it, is copied to the user's PDA upon
installation, or replaced when my Desktop App determines if a new version
has been released. Whenever I add/Change tables, I do so to this Blank DB,
and send it out to the field.

The application itelf does not do anything as far as Change structure or DB
Creation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top