Partager via


Méthode SqlCeEngine.CreateDatabase

Crée une base de données.

Espace de noms :  System.Data.SqlServerCe
Assembly :  System.Data.SqlServerCe (en System.Data.SqlServerCe.dll)

Syntaxe

'Déclaration
<SecurityCriticalAttribute> _
<SecurityTreatAsSafeAttribute> _
<SecurityPermissionAttribute(SecurityAction.Assert, UnmanagedCode := True)> _
Public Sub CreateDatabase
'Utilisation
Dim instance As SqlCeEngine

instance.CreateDatabase()
[SecurityCriticalAttribute]
[SecurityTreatAsSafeAttribute]
[SecurityPermissionAttribute(SecurityAction.Assert, UnmanagedCode = true)]
public void CreateDatabase()
[SecurityCriticalAttribute]
[SecurityTreatAsSafeAttribute]
[SecurityPermissionAttribute(SecurityAction::Assert, UnmanagedCode = true)]
public:
void CreateDatabase()
[<SecurityCriticalAttribute>]
[<SecurityTreatAsSafeAttribute>]
[<SecurityPermissionAttribute(SecurityAction.Assert, UnmanagedCode = true)>]
member CreateDatabase : unit -> unit 
public function CreateDatabase()

Exemples

L'exemple suivant illustre la création d'une base de données 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();

Voir aussi

Référence

SqlCeEngine Classe

Espace de noms System.Data.SqlServerCe