TurboDB ADO.NET Data Provider TurboDBConnection.CreateDatabase Method |
Previous Top Next |
Creates a new TurboDB database.
C#
public void CreateDatabase(TurboDBDatabaseType dbType)
Visual Basic
Public Sub CreateDatabase(dbType As TurboDBDatabaseType)
Description
dbType determines, whether a single-file or directory database is created. You must set the DataSource property to the file name for the new TurboDB database file or directory before calling CreateDatabase.
Compatibility
In version 4 and below this method did not have the parameter. To have the same effect, put TurboDBDatabaseType.SingleFile here. The method was expanded to make it possible to create directory-based databases as well.
In TurboDB Managed the argument to dbType must always be TurboDBDatabaseType.SingleFile because directory-based databases are not supported.
Sample
// This code creates a new TurboDB database file and opens it
TurboDBConnection turboDBConnection = new TurboDBConnection();
turboDBConnection.ConnectionString = @"DataSource=""c:\mydatabases\database98.tdbd"""
turboDBConnection.CreateDatabase(TurboDBDatabaseType.SingleFile);
turboDBConnection.Open();
See also