I have worked with SQLCE 3.1 and SharpDevelop, Try this code and see if this is what you want:
string connStr = "Data Source = FooDatabase.sdf; Password = SomePassword";
if (File.Exists("FooDatabase.sdf"))
File.Delete("FooDatabase.sdf");
SqlCeEngine engine = new SqlCeEngine(connStr);
engine.CreateDatabase();
SqlCeConnection conn = null;
try
{
conn = new SqlCeConnection(connStr);
conn.Open();
SqlCeCommand cmd = conn.CreateCommand();
cmd.CommandText = "CREATE TABLE FooTable(col1 int, col2 ntext)";
cmd.ExecuteNonQuery();
}
catch
{
}
finally
{
conn.Close();
}
Note that the database is just a file, so you can check if the database exists by looking if the file exists, also you can delete the database by deleting the file. Hope this helps.