SqlCeEngine 建構 (String)
使用指定的本機連接字串初始化 SqlCeEngine 類別的新執行個體。
命名空間: System.Data.SqlServerCe
組件: System.Data.SqlServerCe (在 System.Data.SqlServerCe.dll 中)
語法
'宣告
Public Sub New ( _
connectionString As String _
)
'用途
Dim connectionString As String
Dim instance As New SqlCeEngine(connectionString)
public SqlCeEngine(
string connectionString
)
public:
SqlCeEngine(
String^ connectionString
)
new :
connectionString:string -> SqlCeEngine
public function SqlCeEngine(
connectionString : String
)
參數
- connectionString
型別:System. . :: . .String
範例
下列範例示範如何建立新的 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();