SqlCeEngine Constructor (String)

Initializes a new instance of the SqlCeEngine class with the specified local connection string.

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

public SqlCeEngine(
	string connectionString
)

Parameters

connectionString
Type: System.String

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: