Builds a connection string for opening a connection to an UltraLite database.
Public NotInheritable Class ULConnectionStringBuilder Inherits System.Data.Common.DbConnectionStringBuilder
public sealed class ULConnectionStringBuilder : System.Data.Common.DbConnectionStringBuilder
All members of ULConnectionStringBuilder class, including all inherited members.
Name | Description |
---|---|
Initializes a ULConnectionStringBuilder object with its default values. | |
Add method (Inherited from System.Data.Common.DbConnectionStringBuilder) |
Adds an entry with the specified key and value into the System.Data.Common.DbConnectionStringBuilder. |
AppendKeyValuePair method (Inherited from System.Data.Common.DbConnectionStringBuilder) |
Provides an efficient and safe way to append a key and value to an existing System.Text.StringBuilder object. |
Clear method (Inherited from System.Data.Common.DbConnectionStringBuilder) |
Clears the contents of the System.Data.Common.DbConnectionStringBuilder instance. |
ClearPropertyDescriptors method (Inherited from System.Data.Common.DbConnectionStringBuilder) |
Clears the collection of System.ComponentModel.PropertyDescriptor objects on the associated System.Data.Common.DbConnectionStringBuilder. |
Determines whether the ULConnectionStringBuilder object contains a specific keyword. | |
Compares the connection information in this ULConnectionStringBuilder object with the connection information in the supplied DbConnectionStringBuilder object. | |
GetProperties method (Inherited from System.Data.Common.DbConnectionStringBuilder) |
Fills a supplied System.Collections.Hashtable with information about all the properties of this System.Data.Common.DbConnectionStringBuilder. |
Retrieves the short version of the supplied keyword. | |
Removes the entry with the specified key from the ULConnectionStringBuilder object. | |
ShouldSerialize method (Inherited from System.Data.Common.DbConnectionStringBuilder) |
Indicates whether the specified key exists in this System.Data.Common.DbConnectionStringBuilder instance. |
ToString method (Inherited from System.Data.Common.DbConnectionStringBuilder) |
Returns the connection string associated with this System.Data.Common.DbConnectionStringBuilder. |
Retrieves a value corresponding to the supplied key from this ULConnectionStringBuilder object. | |
BrowsableConnectionString property (Inherited from System.Data.Common.DbConnectionStringBuilder) |
Gets or sets a value that indicates whether the System.Data.Common.DbConnectionStringBuilder.ConnectionString property is visible in Visual Studio designers. |
UL Ext: Specifies the size of the cache. | |
Specifies a name for the connection. | |
ConnectionString property (Inherited from System.Data.Common.DbConnectionStringBuilder) |
Gets or sets the connection string associated with the System.Data.Common.DbConnectionStringBuilder. |
Count property (Inherited from System.Data.Common.DbConnectionStringBuilder) |
Gets the current number of keys that are contained within the System.Data.Common.DbConnectionStringBuilder.ConnectionString property. |
Specifies a key for encrypting the database. | |
Specifies a name for the database or the name of a loaded database to which a connection needs to be made. | |
UL Ext: Specifies the path and file name of the UltraLite database on Windows desktop platforms. | |
UL Ext: Specifies the path and file name of the UltraLite database on Windows Mobile. | |
IsFixedSize property (Inherited from System.Data.Common.DbConnectionStringBuilder) |
Gets a value that indicates whether the System.Data.Common.DbConnectionStringBuilder has a fixed size. |
IsReadOnly property (Inherited from System.Data.Common.DbConnectionStringBuilder) |
Gets a value that indicates whether the System.Data.Common.DbConnectionStringBuilder is read-only. |
Keys property (Inherited from System.Data.Common.DbConnectionStringBuilder) |
Gets an System.Collections.ICollection that contains the keys in the System.Data.Common.DbConnectionStringBuilder. |
Specifies whether SQL queries without ORDER BY clauses should perform ordered table scans by default. | |
Specifies the password for the authenticated user. | |
UL Ext: Specifies the reserve file system space for storage of UltraLite persistent data. | |
Specifies the location and then starts the UltraLite engine. | |
Specifies the value of the specified connection keyword. | |
Specifies an authenticated user for the database. | |
Values property (Inherited from System.Data.Common.DbConnectionStringBuilder) |
Gets an System.Collections.ICollection that contains the values in the System.Data.Common.DbConnectionStringBuilder. |
The frequently-used connection parameters are individual properties on the ULConnectionStringBuilder object.
The ULConnectionStringBuilder class is not available in the .NET Compact Framework 2.0.
A ULConnectionStringBuilder object is used to specify the parameters for opening a connection (with the ULConnection.Open method) or dropping a database (with the ULDatabaseManager.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 ULConnectionStringBuilder object, you create a connection string using the System.Data.Common.DbConnectionStringBuilder.ConnectionString. The resulting string is used to create a new ULConnection object with the ULConnection(String) constructor or set the ULConnection.ConnectionString property of an existing ULConnection 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 Mobile, while mydb2.db would be used on other platforms.
' Visual Basic Dim dbName As ULConnectionStringBuilder = _ new ULConnectionStringBuilder dbName.DatabaseOnDevice = "\UltraLite\mydb1.udb" dbName.DatabaseOnDesktop = "somedir\mydb2.udb" |
The following code is the C# language equivalent:
// C# ULConnectionStringBuilder dbName = new ULConnectionStringBuilder(); dbName.DatabaseOnDevice = "\\UltraLite\\mydb1.udb"; dbName.DatabaseOnDesktop = @"somedir\\mydb2.udb"; |
The recommended extension for UltraLite database files is .udb. On Windows Mobile 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.
Optional connection settings
Depending on your application's needs and how the database was created, you might need to supply a non-default ULConnectionStringBuilder.UserID value, a non-default ULConnectionStringBuilder.Password value, a database ULConnectionStringBuilder.DatabaseKey value, and the ULConnectionStringBuilder.CacheSize value. If your application is using multiple connections, you should provide a unique ULConnectionStringBuilder.ConnectionName value 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, call the ULConnection.RevokeConnectFrom method. To add a user or change a user's password, call the ULConnection.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 ULConnection.ChangeEncryptionKey method.
ULConnectionStringBuilder constructor
ContainsKey method
EquivalentTo method
GetShortName method
Remove method
TryGetValue method
CacheSize property
ConnectionName property
DatabaseKey property
DatabaseName property
DatabaseOnDesktop property
DatabaseOnDevice property
OrderedTableScans property
Password property
ReserveSize property
StartLine property
this property
UserID property
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |