Creates a new UltraLite database.
Visual Basic
Public Sub CreateDatabase( _
ByVal connString As String, _
ByVal collationData As Byte(), _
ByVal createParms As String _
)
C#
public void CreateDatabase(
string connString,
byte[] collationData,
string createParms
);
connString The parameters for identifying a database in the form of a semicolon-separated list of keyword-value pairs. For more information, see the ULConnectionParms class.
collationData The collation data specifying how the database will store and compare strings.
createParms The parameters used to configure the new database in the form of a semicolon-separated list of keyword-value pairs. For more information, see the ULCreateParms class.
To specify a collation, you must first include the appropriate collation data source file from the src\ulcollations\cs (for C# projects) or src\ulcollations\vb.net (for Visual Basic projects) subdirectory of your SQL Anywhere installation directory. Once included in your project, use the collation's Data property to supply the collation data to the CreateDatabase() method.
ULException class - A SQL error occurred.
The following code creates the database \UltraLite\MyDatabase.udb on a Windows CE device then opens a connection to it.
' Visual Basic Dim openParms As ULConnectionParms = New ULConnectionParms openParms.DatabaseOnCE = "\UltraLite\MyDatabase.udb" ' Assumes file src\ulcollations\vb.net\coll_1250LATIN2.vb is ' also compiled in the current project ULConnection.DatabaseManager.CreateDatabase( _ openParms.ToString(), _ iAnywhere.UltraLite.Collations.Collation_1250LATIN2.Data, _ "" _ ) Dim conn As ULConnection = _ New ULConnection( openParms.ToString() ) conn.Open() // C# ULConnectionParms openParms = new ULConnectionParms(); openParms.DatabaseOnCE = @"\UltraLite\MyDatabase.udb"; // Assumes file src\ulcollations\cs\coll_1250LATIN2.cs is // also compiled in the current project ULConnection.DatabaseManager.CreateDatabase( openParms.ToString(), iAnywhere.UltraLite.Collations.Collation_1250LATIN2.Data, "" ); ULConnection conn = new ULConnection( openParms.ToString() ); conn.Open();