Export (0) Print
Expand All

SqlCeEngine.CreateDatabase Method

Creates a new database.

Namespace:  System.Data.SqlServerCe
Assembly:  System.Data.SqlServerCe (in System.Data.SqlServerCe.dll)

[SecurityCriticalAttribute]
[SecurityTreatAsSafeAttribute]
[SecurityPermissionAttribute(SecurityAction.Assert, UnmanagedCode = true)]
public void CreateDatabase()

The following sample demonstrates how to create a new SQL Server Compact database.

File.Delete("Test.sdf");

string connString = "Data Source='Test.sdf'; LCID=1033; Password=\"s$;2'!dS64\"; Encrypt = TRUE;";
SqlCeEngine engine = new SqlCeEngine(connString);
engine.CreateDatabase();


Show:
© 2014 Microsoft