Collection Contents Index StateChange event Next PDF

UltraLiteŽ - .NET Programming
  iAnywhere.Data.UltraLite namespace (.NET 1.0)
ULConnectionParms class


UL Ext.: Builds a connection string for opening a connection to an UltraLite database. The frequently-used connection parameters are individual properties on the ULConnectionParms object.

Prototypes

' Visual Basic

Public Class ULConnectionParms
Inherits Component

// C#

public class ULConnectionParms :
Component

Remarks

A ULConnectionParms object is used to specify the parameters for opening a connection (Open method) or dropping a database (DropDatabase method).

Leading and trailing spaces are ignored in all values. Values must not contain leading or trailing spaces, or a semicolon (;), or begin with either a single quote (') or a double quote (").

When building a connection string, you need to identify the database and specify any optional connection settings. Once you have supplied all the connection parameters by setting the appropriate properties on a ULConnectionParms object, you create a connection string using the ToString method. The resulting string is used to create a new ULConnection class with the ULConnection constructor constructor or set the ConnectionString property of an existing ULConnection class object.

Identifying the database

Each instance contains platform-specific paths to the database. Only the value corresponding to the executing platform is used. For example, in the code below the path \UltraLite\mydb1.udb would be used on Windows CE, while mydb2.db would be used on other platforms.

' Visual Basic
Dim dbName As ULConnectionParms = new ULConnectionParms
dbName.DatabaseOnCE = "\UltraLite\mydb1.udb"
dbName.DatabaseOnDesktop = "somedir\mydb2.udb"

// C#
ULConnectionParms dbName = new ULConnectionParms();
dbName.DatabaseOnCE = "\\UltraLite\\mydb1.udb";
dbName.DatabaseOnDesktop = @"somedir\mydb2.udb";

The recommended extension for UltraLite database files is .udb. On Windows CE devices, the default database is \UltraLiteDB\ulstore.udb. On other Windows platforms, the default database is ulstore.udb. In C#, you must escape any backslash characters in paths or use @-quoted string literals.

If you are using multiple databases, you must specify a database name for each database. For more informaton, see the AdditionalParms property.

Optional connection settings

Depending on your application's needs and how the database was created, you might need to supply a non-default UserID property and Password property, a database EncryptionKey property, and the connection CacheSize property. If your application is using multiple connections, you should provide a unique ConnectionName property for each connection.

Databases are created with a single authenticated user, DBA, whose initial password is sql. By default, connections are opened using the user ID DBA and password sql. To disable the default user, use the RevokeConnectFrom method. To add a user or change a user's password, use the GrantConnectTo method.

If an encryption key was supplied when the database was created, all subsequent connections to the database must use the same encryption key. To change a database's encryption key, use the ChangeEncryptionKey method.

For more information, see UltraLite Connection String Parameters Reference.


ULConnectionParms members
ULConnectionParms constructor
AdditionalParms property
CacheSize property
ConnectionName property
DatabaseOnCE property
DatabaseOnDesktop property
EncryptionKey property
Password property
UserID property
ToString method
UnusedEvent event

Collection Contents Index StateChange event Next PDF