Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » UltraLite - .NET Programming » UltraLite .NET 2.0 API Reference » ULDatabaseManager class

RuntimeType property Next Page

CreateDatabase method


Creates a new UltraLite database.

Syntax

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
);

Parameters
Remarks

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.

Example

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();
See also