SqlCeEngine 构造函数
初始化 SqlCeEngine 类的新实例。
命名空间: System.Data.SqlServerCe
程序集: System.Data.SqlServerCe(在 System.Data.SqlServerCe.dll 中)
语法
声明
<SecurityTreatAsSafeAttribute> _
<SecurityCriticalAttribute> _
Public Sub New
用法
Dim instance As New SqlCeEngine()
[SecurityTreatAsSafeAttribute]
[SecurityCriticalAttribute]
public SqlCeEngine()
[SecurityTreatAsSafeAttribute]
[SecurityCriticalAttribute]
public:
SqlCeEngine()
[<SecurityTreatAsSafeAttribute>]
[<SecurityCriticalAttribute>]
new : unit -> SqlCeEngine
public function SqlCeEngine()
示例
下面的示例说明如何创建一个新的 SQL Server Compact 数据库。
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();