SqlCeEngine 建構
初始化 SqlCeEngine 類別的新執行個體。
命名空間: System.Data.SqlServerCe
組件: System.Data.SqlServerCe (在 System.Data.SqlServerCe.dll 中)
語法
'宣告
Public Sub New
'用途
Dim instance As New SqlCeEngine()
public SqlCeEngine()
public:
SqlCeEngine()
new : unit -> SqlCeEngine
public function SqlCeEngine()
範例
下列範例示範如何建立新的 SQL Server Compact 3.5 資料庫。
File.Delete("Test.sdf")
Dim connString As String = "Data Source='Test.sdf'; LCID=1033; Password=""s$;2'!dS64""; Encrypt = TRUE;"
Dim engine As New SqlCeEngine(connString)
engine.CreateDatabase()
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();