A little help on the process of app/db creation

  • Thread starter Thread starter Jon
  • Start date Start date
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!
 
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
 
You can also pre-create the database on the device or
emulator, copy it on the desktop and use it for
distribution to users.
 
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
 
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





.
 
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.
 
Back
Top