UltraLite DOTNET API Reference en PDF
UltraLite DOTNET API Reference en PDF
UltraLite.NET supports Microsoft Windows Mobile devices. Third-party software is required for database
development.
Development platforms
Target platforms
The UltraLite.NET API provides the Sap.Data.UltraLite namespace. This namespace provides a Microsoft
ADO.NET interface to UltraLite. It has the advantage of being built on an industry-standard model and
providing a migration path to the SQL Anywhere ADO.NET interface, which is very similar.
The .NET Compact Framework is the Microsoft .NET runtime component for Microsoft Windows Mobile. It
supports several programming languages. You can use either Visual Basic.NET or C# to build applications
using UltraLite.NET.
Note
You can use the UltraLite C++ API as an alternative to the UltraLite.NET API to create applications for
Microsoft Windows Mobile devices and desktop.
In this section:
Data creation and modification in UltraLite.NET using the ULTable class [page 14]
UltraLite applications can access table data using SQL statements or by using the ULTable class.
Microsoft Visual Studio integration is supported for UltraLite.NET. You can access the SQL Anywhere
integration tools from the Microsoft Visual Studio Server Explorer in Microsoft Visual Studio 2005 or later.
UltraLite applications must connect to a database before carrying out operations on the data in it.
Note
The code samples in this chapter are written in Microsoft C#. If you are using one of the other supported
development tools, you must modify the instructions appropriately.
Most applications use a single connection to an UltraLite database and leave the connection open. Multiple
connections are only required for multithreaded data access. For this reason, it is often best to declare the
ULConnection object as global to the application.
The following properties of the ULConnection object govern global application behavior.
Commit behavior
By default, UltraLite.NET applications are in AutoCommit mode. Each Insert, Update, or Delete statement
is committed to the database immediately. You can use ULConnection.BeginTransaction to define the start
of a transaction in your application.
User authentication
You can change the user ID and password for the application from the default values of DBA and sql,
respectively, by using methods. Each UltraLite database can define a maximum of four user IDs.
Synchronization
A set of objects is provided to handle the execution of dynamic SQL statements and to navigate result sets.
Each ULConnection object and all objects created from it should be used on a single thread. If your application
requires multiple threads accessing the UltraLite database, each thread requires a separate connection. For
example, if you design your application to perform synchronization in a separate thread, you must use a
separate connection for the synchronization and you must open the connection from that thread.
In this section:
Related Information
Procedure
ULConnection conn;
You can specify connection parameters either as a connection string or using the ULConnectionParms
object.
Next Steps
Use the database connection to perform SQL operations that create, modify, or delete data. You can modify
existing database options on an open connection. Close the ULConnection object when finished.
UltraLite applications can access table data using SQL statements or the Table API.
In this section:
Data modification in UltraLite.NET using INSERT, UPDATE, and DELETE [page 10]
With UltraLite, you can perform SQL data manipulation language operations. These operations are
performed using the ULCommand.ExecuteNonQuery method.
Related Information
Data creation and modification in UltraLite.NET using the ULTable class [page 14]
With UltraLite, you can perform SQL data manipulation language operations. These operations are performed
using the ULCommand.ExecuteNonQuery method.
In this section:
Placeholders for parameters in SQL statements are indicated by the ? character. For any INSERT, UPDATE, or
DELETE, each ? is referenced according to its ordinal position in the command's parameters collection. For
example, the first ? is referred to as 0, and the second as 1.
Procedure
1. Declare a ULCommand.
ULCommand cmd;
cmd = conn.CreateCommand();
cmd.CommandText = "INSERT INTO MyTable(MyColumn) values (?)";
String newValue;
cmd.Parameters.Clear();
// assign value
cmd.Parameters.Add("", newValue);
The return value indicates the number of rows affected by the statement.
myTransaction.Commit();
Results
A new row is added to MyTable where the MyColumn value is set to an empty string.
Placeholders for parameters in SQL statements are indicated by the ? character. For any INSERT, UPDATE, or
DELETE, each ? is referenced according to its ordinal position in the command's parameters collection. For
example, the first ? is referred to as 0, and the second as 1.
Procedure
1. Declare a ULCommand.
ULCommand cmd;
cmd = conn.CreateCommand();
cmd.CommandText = "UPDATE MyTable SET MyColumn1 = ? WHERE MyColumn2 = ?";
String newValue;
String oldValue;
cmd.Parameters.Clear();
// assign values
cmd.Parameters.Add("", newValue);
cmd.Parameters.Add("", oldValue);
myTransaction.Commit();
Row entries from MyTable are updated where the MyColumn1 value is an empty string. In this scenario, the
MyColumn2 value is also set to an empty string.
Placeholders for parameters in SQL statements are indicated by the ? character. For any INSERT, UPDATE, or
DELETE, each ? is referenced according to its ordinal position in the command's parameters collection. For
example, the first ? is referred to as 0, and the second as 1.
Procedure
1. Declare a ULCommand.
ULCommand cmd;
cmd = conn.CreateCommand();
cmd.CommandText = "DELETE FROM MyTable WHERE MyColumn = ?";
String deleteValue;
cmd.Parameters.Clear();
// assign value
cmd.Parameters.Add("", deleteValue);
myTransaction.Commit();
Results
Row entries from MyTable are deleted where the MyColumn value in the table is an empty string.
Execute a SELECT statement to retrieve information from an UltraLite database and handle the result set that
is returned.
Procedure
ULCommand cmd;
cmd = conn.CreateCommand();
cmd.CommandText = "SELECT MyColumn FROM MyTable";
Query results can be returned as one of several types of objects. In this example, a ULDataReader object is
used.
Results
The result of the SELECT statement contains a string, which is then output to the command prompt.
Example
The following example demonstrates how to use the ULDataReader.Schema and ResultSet.Schema
properties to display schema information in a command prompt.
You can navigate through a result set using methods associated with the ULDataReader object.
The result set object provides you with the following methods to navigate a result set:
MoveAfterLast
moves a certain number of rows relative to the current row, as specified by the offset. Positive offset values
move forward in the result set, relative to the current position of the cursor in the result set, and negative
offset values move backward in the result set. An offset value of zero does not move the cursor, but allows
you to repopulate the row buffer.
UltraLite applications can access table data using SQL statements or by using the ULTable class.
In this section:
Related Information
The table object provides you with the following methods to navigate a table.
MoveAfterLast
moves a certain number of rows relative to the current row, as specified by the offset. Positive offset values
move forward in the table, relative to the current position of the cursor in the table, and negative offset
values move backward in the table. An offset value of zero does not move the cursor, but allows you to
repopulate the row buffer.
Example
The following code opens the MyTable table and displays the value of the MyColumn column for each row.
You expose the rows of the table to the application when you open the table object. By default, the rows are
ordered by primary key value, but you can specify an index when opening a table to access the rows in a
particular order.
Example
The following code moves to the first row of the MyTable table as ordered by the ix_col index.
An UltraLite mode determines the purpose for which the values in the buffer are used. UltraLite has the
following four modes of operation, in addition to a default mode.
Insert mode
The data in the buffer is added to the table as a new row when the insert method is called.
Update mode
The data in the buffer replaces the current row when the update method is called.
Find mode
Used to locate a row whose value exactly matches the data in the buffer when one of the find methods is
called.
Lookup mode
Used to locate a row whose value matches or is greater than the data in the buffer when one of the lookup
methods is called.
The steps to insert a row are very similar to those for updating rows, except that there is no need to locate a row
in the table before carrying out the insert operation.
Example
t.InsertBegin();
t.SetInt( id, 3 );
t.SetString( lname, "Carlo" );
t.Insert();
If you do not set a value for one of the columns, and that column has a default, the default value is used. If
the column has no default, one of the following entries is used:
For update operations, an insert is applied to the database in permanent storage when a commit is carried
out. In AutoCommit mode, a commit is carried out as part of the insert method.
By default, UltraLite.NET operates in AutoCommit mode, so that the update is immediately applied to the row
in permanent storage. If you have disabled AutoCommit mode, the update is not applied until you execute a
commit operation.
Caution
You cannot update the primary key value of a row. Delete the row and add a new row instead.
In this section:
Related Information
Procedure
You can move to a row by scrolling through the table or by searching the table using find or lookup
methods.
2. Enter update mode.
t.UpdateBegin();
For example, the following instruction sets the id column in the buffer to 3.
t.SetInt( id , 3);
t.Update();
Results
The current row is updated. If you changed the value of a column in the index specified when the Table object
was opened, the current row is undefined.
UltraLite has several modes of operation for working with data. Two of these modes, the find and lookup
modes, are used for searching. The Table object has methods corresponding to these modes for locating
particular rows in a table.
Note
The columns searched using Find and Lookup methods must be in the index used to open the table.
Find methods
move to the first row that exactly matches specified search values, under the sort order specified when the
Table object was opened. If the search values cannot be found, the application is positioned before the first
or after the last row.
move to the first row that matches or is greater than a specified search value, under the sort order
specified when the Table object was opened.
In this section:
Searching for a row with the find and lookup methods [page 19]
Use the find and lookup methods to search for a row in a ULTable object.
Use the find and lookup methods to search for a row in a ULTable object.
Procedure
The mode is entered by calling a method on the table object. For example, the following code enters find
mode.
t.FindBegin();
You do this by setting values in the current row. Setting these values affects the buffer holding the current
row only, not the database. For example, the following code sets the value in the buffer to Kaminski.
Use the appropriate method to perform the search. For example, the following instruction looks for the first
row that exactly matches the specified value in the current index.
For multi-column indexes, a value for the first column is always used, but you can omit the other columns.
t.FindFirst();
Use the appropriate method to perform the search. For a find operation, FindNext locates the next instance
of the parameters in the index. For a lookup, MoveNext locates the next instance.
Next Steps
Perform operations on the row, such as delete, or modify data that pertains to the row.
Row operations can be managed using various methods in the ULTable class.
If the Table object is positioned on a row, you can use one of a set of methods appropriate for the data type to
retrieve or modify the value of each column.
The Table object provides a set of methods for retrieving column values. These methods take the column ID as
argument.
Example
The following code retrieves the value of the lname column, which is a character string.
The following code retrieves the value of the cust_id column, which is an integer.
In addition to the methods for retrieving values, there are methods for setting values. These methods take the
column ID and the value as arguments.
For example, the following code sets the value of the lname column to Kaminski.
By assigning values to these properties you do not alter the value of the data in the database. You can
assign values to the properties even if you are before the first row or after the last row of the table, but it is
an error to try to access data when the current row is at one of these positions, for example, by assigning
the property to a variable.
Casting values
The method you choose must match the data type you want to assign. UltraLite automatically casts database
data types where they are compatible, so that you could use the getString method to fetch an integer value into
a string variable, and so on.
The steps to delete a row are simpler than to insert or update rows. There is no delete mode corresponding to
the insert or update modes.
You delete a row by moving the cursor to the row you want to delete and then executing the Table.Delete
method.
Example
The following code illustrates how to delete the first row in a table:
t.MoveFirst();
t.Delete();
UltraLite provides transaction processing to ensure the integrity of the data in your database. A transaction is a
logical unit of work. Either an entire transaction is executed, or none of the statements in the transaction are
executed.
By default, UltraLite.NET operates in AutoCommit mode, so that each insert, update, or delete is executed as a
separate transaction. Once the operation is complete, the change is made to the database.
If the connection has performed a valid transaction, you must execute ULTransaction.Commit statement to
complete the transaction and commit the changes to your database. If the set of updates is to be abandoned,
execute ULTransaction.Rollback statement to cancel and roll back all the operations of the transaction. Once a
transaction has been committed or rolled back, the connection will revert to AutoCommit mode until a
subsequent call to ULConnection.BeginTransaction.
For example, the following code fragment shows how to set up a transaction that involves multiple operations
(avoiding the default autocommit behavior):
Note
UltraLite supports only the ReadCommitted and ReadUncommitted members of the IsolationLevel
enumeration.
Some SQL statements, especially statements that alter the structure of the database, cause any pending
transactions to be committed. Examples of SQL statements that automatically commit transactions in
progress are: CREATE TABLE and ALTER TABLE.
The objects in the table API represent tables, columns, indexes, and synchronization publications. Each object
has a Schema property that provides access to information about the structure of that object.
You cannot modify the schema through the API. You can only retrieve information about the schema.
ULDatabaseSchema
Exposes the number and names of the tables in the database, and the global properties such as the format
of dates and times.
The number and names of the columns and indexes for this table.
Information about the column in the index. As an index has no data directly associated with it there is no
separate Index class, just a ULIndexSchema class.
You can use ULException.NativeError to retrieve the ULSQLCode value assigned to this error. ULException has
a Message property, which you can use to obtain a descriptive text of the error. ULSQLCode errors are negative
numbers indicating the error type.
After synchronization, you can use the SyncResult property of the connection to obtain more detailed error
information. For example, the following sample illustrates a possible technique for reporting errors that occur
during synchronization:
You can find a working example of synchronization in the CustDB sample application. For more information,
see the Samples\UltraLite.NET\CustDB subdirectory of your SQL Anywhere 17 installation.
UltraLite.NET supports TCP/IP, HTTP, HTTPS, and TLS (transport layer security) synchronization.
Synchronization is initiated by the UltraLite application. Always use properties of the SyncParms object to
control synchronization.
Microsoft ActiveSync synchronization can be added to an UltraLite.NET application, and your application can
be registered for use with Microsoft ActiveSync on your end users' computers.
Microsoft ActiveSync synchronization can only be initiated by Microsoft ActiveSync. Microsoft ActiveSync
initiates synchronization when the device is placed in the cradle or when Synchronize is selected from the
Microsoft ActiveSync window.
When Microsoft ActiveSync initiates synchronization, the MobiLink provider for Microsoft ActiveSync starts the
UltraLite application, if it is not already running, and sends a message to it. Your application must implement a
ULActiveSyncListener object to receive and process messages from the MobiLink provider. Your application
must specify the listener object using the SetActiveSyncListener method, where MyAppClassName is a unique
Microsoft Windows class name for the application.
If your application is multithreaded, use a separate connection and use the lock keyword in Microsoft C# or
SyncLock keyword in Microsoft Visual Basic .NET to access any objects shared with the rest of the application.
The ActiveSyncInvoked method should specify a ULStreamType.ACTIVE_SYNC for its connection's
SyncParms.Stream and then call ULConnection.Synchronize.
Class Name
The same class name the application used with the Connection.SetActiveSyncListener method.
UltraLite.NET applications can be deployed to Microsoft Windows Mobile and Microsoft Windows. If you are
deploying to Microsoft Windows Mobile, UltraLite.NET requires the Microsoft .NET Compact Framework. If you
are deploying to Microsoft Windows, it requires the Microsoft .NET Framework. UltraLite.NET also supports
Microsoft ActiveSync synchronization.
In this section:
Deploying an UltraLite.NET application for Windows Mobile (UltraLite engine) [page 27]
Specify appropriate creation parameters, connection parameters, synchronization parameters,
protocol options, references, and deployment files to ensure that your UltraLite.NET application runs
successfully.
Procedure
3. When using RSA end-to-end encryption, set the protocol option e2ee_public_key= key-file.
4. When using ZLIB compression, set the protocol option compression=zlib.
5. Add references to:
○ Sap.Data.UltraLite
○ Sap.Data.UltraLite.resources
6. Deploy the following files:
○ %SQLANY17%\UltraLite\UltraLite.NET\Assembly\V2\Sap.Data.UltraLite.dll.
○ %SQLANY17%\UltraLite\UltraLite.NET\Assembly\V2\en
\Sap.Data.UltraLite.resources.dll.
○ ulnet17.dll, located in %SQLANY17%\UltraLite\UltraLite.NET\CE\Arm50 for Microsoft
Windows Mobile. For Microsoft Windows, it is located in %SQLANY17%\UltraLite\UltraLite.NET
\x64 or %SQLANY17%\UltraLite\UltraLite.NET\win32.
7. Deploy the files appropriate for your application:
○ When using ZLIB compression, mlczlib17.dll.
○ When using RSA TLS, RSA HTTPS, or RSA E2EE, mlcrsa17.dll.
For Microsoft Windows Mobile, the files are located in %SQLANY17%\UltraLite\CE\Arm.50. For
Microsoft Windows, the files are located in %SQLANY17%\UltraLite\Windows\x64 or %SQLANY17%
\UltraLite\Windows\x86.
Results
The UltraLite.NET application runs successfully on the Microsoft Windows desktop or Microsoft Windows
Mobile device that it is deployed to.
Next Steps
Deploy an UltraLite database to the Microsoft Windows desktop or Microsoft Windows Mobile device that the
application was deployed to, or create a new database with the deployed application.
Procedure
3. When using RSA end-to-end encryption, set the protocol option e2ee_public_key= key-file.
4. When using ZLIB compression, set the protocol option compression=zlib.
5. Add references to:
○ Sap.Data.UltraLite
○ Sap.Data.UltraLite.resources
6. Deploy the following files:
○ %SQLANY17%\UltraLite\UltraLite.NET\Assembly\V2\Sap.Data.UltraLite.dll.
○ %SQLANY17%\UltraLite\UltraLite.NET\Assembly\V2\en
\Sap.Data.UltraLite.resources.dll.
○ ulnetclient17.dll, located in %SQLANY17%\UltraLite\UltraLite.NET\CE\Arm50 for
Windows Mobile. For Windows, it is located in %SQLANY17%\UltraLite\UltraLite.NET\x64 or
%SQLANY17%\UltraLite\UltraLite.NET\win32.
7. Deploy the files appropriate for your application:
○ uleng17.exe.
○ When using ZLIB compression, mlczlib17.dll.
○ When using RSA TLS, RSA HTTPS, or RSA E2EE, mlcrsa17.dll.
For Windows Mobile, the files are located in %SQLANY17%\UltraLite\CE\Arm.50. For Windows, the
files are located in %SQLANY17%\UltraLite\Windows\x64 or %SQLANY17%\UltraLite\Windows
\x86.
The UltraLite.NET application, which uses the UltraLite engine, runs successfully on the Windows desktop or
Windows Mobile device that it is deployed to.
Next Steps
Deploy an UltraLite database to the Windows desktop or Windows Mobile device that the application was
deployed to, or create a new database with the deployed application.
This tutorial guides you through the process of building an UltraLite application for Microsoft Windows Mobile
using Microsoft Visual Studio. It uses the Microsoft ADO.NET interface provided by the Sap.Data.UltraLite
namespace and runs on the Microsoft .NET 3.5 Compact Framework.
Prerequisites
● You are familiar with the C# programming language or the Microsoft Visual Basic programming language.
● You know how to create an UltraLite database using the UltraLite plug-in for SQL Central.
● You have Microsoft Visual Studio installed on your computer and you are familiar with using Microsoft
Visual Studio. This tutorial is tested using Microsoft Visual Studio 2008 and may refer to Microsoft Visual
Studio actions or procedures that may be slightly different in other versions of Microsoft Visual Studio.
● You have installed the Microsoft Windows Mobile 5.0 SDK or later from Microsoft
● You have installed the Microsoft .NET 3.5 Compact Framework to your mobile device
Context
The goal for the tutorial is to gain competence and familiarity with the process of developing UltraLite
applications in the Microsoft Visual Studio environment.
This tutorial contains code for a Microsoft Visual Basic application and a Microsoft Visual C# application.
If you install UltraLite software on a Microsoft Windows computer that already has Microsoft Visual Studio
installed, the UltraLite installation process detects the presence of Microsoft Visual Studio and performs the
necessary integration steps. If you install Microsoft Visual Studio after installing UltraLite, or install a new
version of Microsoft Visual Studio, the process to integrate UltraLite with Microsoft Visual Studio must be
performed manually at a command prompt as follows:
In this lesson, you create and configure a new Microsoft Visual Studio application. You can choose whether to
use Microsoft Visual Basic or C# as your programming language.
Prerequisites
This lesson assumes that you have installed the required software.
Context
This tutorial assumes that if you are designing a C# application, your files are in the directory C:\tutorial
\uldotnet\CSApp and that if you are designing a Microsoft Visual Basic application, your files are in the
directory C:\tutorial\uldotnet\VBApp. If you choose to use a directory with a different name, use that
directory throughout the tutorial.
Procedure
If the Microsoft Visual Studio toolbox panel is not currently displayed, from the main menu click View
Toolbox . Add the following visual components to the form by selecting the object from the toolbox and
dragging it onto the form in the desired location.
Button btnInsert
Button btnUpdate
Button btnDelete
TextBox txtName
ListBox lbNames
Label laName
Building and deploying the solution confirms that you have configured your Microsoft Visual Studio project
properly.
a. From the Build menu, click Build Solution. Confirm that the project builds successfully. If you are
building a Microsoft Visual Basic application, you can ignore the following warning that may appear:
This action deploys your application to the mobile device or emulator, and starts it. The application is
deployed to the emulator or device location: \Program Files\VBApp or \Program Files\CSApp
depending on your project name.
The UltraLite.NET API is functional in the new Microsoft Windows Mobile application.
Next Steps
Task overview: Tutorial: Building a Microsoft Windows Mobile application using UltraLite.NET [page 29]
In this lesson, you create an UltraLite database using SQL Central on a desktop PC.
Prerequisites
You must have the roles and privileges listed at the beginning of this tutorial.
Procedure
In general, the default database characteristics provided by SQL Central are suitable. Note the following
characteristics:
c:\tutorial\uldotnet\VBApp\VBApp.udb or c:\tutorial\uldotnet\CSApp\CSApp.udb,
depending on your application type.
DBA user ID and password
Set to DBA and sql, respectively, for the purposes of examples in this documentation.
Collation sequence
Table name
Type Names.
Columns
Primary key
4. Exit SQL Central and verify the database file is created in the required directory.
5. Link the initialized (empty) database file to your Microsoft Visual Studio project so that the database file is
deployed to the device along with the application code:
○ From the Visual Studio menu, click Project Add Existing Item .
○ Ensure that Objects of Type is set to All Files. Browse to the directory where you created the database
file and click the file VBApp.udb or CSApp.udb depending on your application type.
○ Click the arrow in the Add button and click Add As Link.
○ In the Solution Explorer frame, right click the database file name that has just been added to the
project and click Properties.
In the properties panel, set the Build Action property to Content; set the Copy to Output Directory
property to Copy always.
Results
Next Steps
Task overview: Tutorial: Building a Microsoft Windows Mobile application using UltraLite.NET [page 29]
Next task: Lesson 3: Adding database connection controls to the application [page 35]
In this lesson, you add a control to your UltraLite.NET application that establishes a connection to an UltraLite
database.
Prerequisites
You must have the roles and privileges listed at the beginning of this tutorial.
Procedure
Add the following statement as the very first line of the file.
//Microsoft Visual C#
using Sap.Data.UltraLite;
For Microsoft Visual C#, add the following code after the code describing the form components and before
the first method declaration.
//Microsoft Visual C#
private ULConnection Conn;
private int[] ids;
For Microsoft Visual Basic, add the following code at the beginning of the Form1 class.
ULConnection
A Connection object is the root object for all actions executed on a connection to a database.
ids
The ids array is used to hold the ID column values returned after executing a query.
Although the ListBox control itself allows you access to sequential numbers, those numbers differ from
the value of the ID column once a row has been deleted. For this reason, the ID column values must be
stored separately.
4. Double-click a blank area of your form to create a Form1_Load method.
//Microsoft Visual C#
try {
String ConnString = "dbf=\\Program Files\\CSApp\\CSApp.udb";
Conn = new ULConnection( ConnString );
Conn.Open();
Conn.DatabaseID = 1;
RefreshListBox();
}
catch ( System.Exception t ) {
MessageBox.Show( "Exception: " + t.Message);
}
For Microsoft Visual Basic, add the following code to the Form1_Load method.
From the Build menu, click Build Solution. At this stage, you may receive a single error reported; for
example in C#: error CS0103: The name 'RefreshListBox' does not exist in the current
context. because RefreshListBox is not yet declared. The next lesson adds that function.
If you get other errors, you must correct them before proceeding. Check for common errors, such as case
inconsistencies in C#. For example, UltraLite and ULConnection must match case exactly. In Microsoft
Visual Basic you must include the Imports Sap.Data.UltraLite statement described in Lesson 3.
Task overview: Tutorial: Building a Microsoft Windows Mobile application using UltraLite.NET [page 29]
Next task: Lesson 4: Inserting, updating, and deleting data [page 37]
In this lesson, you add code to your application that uses Dynamic SQL to modify the data in your database.
Prerequisites
You must have the roles and privileges listed at the beginning of this tutorial.
Context
In this lesson, you create a supporting method to maintain the listbox. This approach is required for the data
manipulation methods used in the remaining procedures.
Procedure
For C#, add the following code to your application as a method of the Form1 class.
//Microsoft Visual C#
private void RefreshListBox(){
try{
long NumRows;
int I = 0;
lbNames.Items.Clear();
using( ULCommand cmd = Conn.CreateCommand() ){
cmd.CommandText = "SELECT ID, Name FROM Names";
using( ULDataReader dr = cmd.ExecuteReader()){
dr.MoveBeforeFirst();
NumRows = dr.RowCount;
ids = new int[ NumRows ];
while (dr.MoveNext())
{
lbNames.Items.Add(
dr.GetString(1));
ids[ I ] = dr.GetInt32(0);
I++;
}
}
txtName.Text = " ";
}
}
catch( Exception err ){
MessageBox.Show(
"Exception in RefreshListBox: " + err.Message );
}
}
For Microsoft Visual Basic, add the following code to your application as a method of the Form1 class.
For Microsoft C#, add the following code to the btnInsert_Click method.
//Microsoft Visual C#
try {
long RowsInserted;
using( ULCommand cmd = Conn.CreateCommand() ) {
cmd.CommandText =
"INSERT INTO Names(name) VALUES (?)";
cmd.Parameters.Add("", txtName.Text);
RowsInserted = cmd.ExecuteNonQuery();
}
RefreshListBox();
}
catch( Exception err ) {
MessageBox.Show("Exception: " + err.Message );
}
For Microsoft Visual Basic, add the following code to the btnInsert_Click method.
5. On the form design tab, double-click Update to create a btnUpdate_Click method. This method carries out
the following tasks:
○ Instantiates a ULCommand object and assigns it an UPDATE statement that inserts the value in the
text box into the database based on the associated ID.
○ Executes the statement.
○ Disposes of the ULCommand object.
○ Refreshes the listbox.
○ If an error occurs, prints the error message. For SQL errors, the code also prints the error code.
For Microsoft C#, add the following code to the btnUpdate_Click method.
//Microsoft Visual C#
try {
long RowsUpdated;
int updateID = ids[ lbNames.SelectedIndex ];
using( ULCommand cmd = Conn.CreateCommand() ){
cmd.CommandText =
"UPDATE Names SET name = ? WHERE id = ?" ;
cmd.Parameters.Add("", txtName.Text );
cmd.Parameters.Add("", updateID);
RowsUpdated = cmd.ExecuteNonQuery();
}
RefreshListBox();
}
For Microsoft Visual Basic, add the following code to the btnUpdate_Click method.
6. On the form design tab, double-click Delete to create a btnDelete_Click method. Add code to perform the
following tasks:
○ Instantiates a ULCommand object and assigns it a DELETE statement. The DELETE statement deletes
the selected row from the database, based on the associated ID from the integer array ids.
○ Executes the statement.
○ Disposes of the ULCommand object.
○ Refreshes the listbox.
○ If an error occurs, displays the error message. For SQL errors, the code also displays the error code.
For Microsoft C#, add the following code to the btnDelete_Click method.
//Microsoft Visual C#
try{
long RowsDeleted;
int deleteID = ids[lbNames.SelectedIndex];
using( ULCommand cmd = Conn.CreateCommand() ){
cmd.CommandText =
"DELETE From Names WHERE id = ?" ;
cmd.Parameters.Add("", deleteID);
RowsDeleted = cmd.ExecuteNonQuery ();
}
RefreshListBox();
}
catch( Exception err ) {
MessageBox.Show("Exception: " + err.Message );
}
For Microsoft Visual Basic, add the following code to the btnDelete_Click method.
Results
The Microsoft Windows Mobile application is set up to perform data operations on the UltraLite database.
Next Steps
Task overview: Tutorial: Building a Microsoft Windows Mobile application using UltraLite.NET [page 29]
Previous task: Lesson 3: Adding database connection controls to the application [page 35]
Next task: Lesson 5: Building and deploying the application [page 41]
Related Information
Data creation and modification in UltraLite.NET using the ULTable class [page 14]
In this lesson, you build your application and deploy it to a remote device or emulator.
Prerequisites
You must have the roles and privileges listed at the beginning of this tutorial.
The deployment target must match the version of ulnet17.dll that you included in your application.
This builds an executable file containing your application and deploys it to the emulator. The process may
take some time, especially if it must deploy the Microsoft .NET Compact Framework before running the
application.
4. If errors are reported, use the following checklist to ensure that your deployment was completed
successfully:
○ Confirm that the application is deployed into \Program Files\appname, where appname is the
name you gave your application in Lesson 1 (CSApp or VBApp).
○ Confirm that the path to the database file in your application code is correct.
○ Confirm that you chose Link File when adding the database file to the project and you set the Build
Action to Content Only and Copy to Output Directory is set to Copy Always. If you did not set these
options correctly, the files will not be deployed to the device.
○ Ensure that you added a reference to the correct version of ulnet17.dll for your target platform, or
ran the Microsoft Windows Mobile installer. For versions of Microsoft Windows Mobile earlier than
Microsoft Windows Mobile 5.0, if you switch between the emulator and a real device, you must change
the version of the library that you use.
○ You may want to exit the emulator without saving the emulator state. Redeploying the application
copies all required files to the emulator, and ensures there are no version problems.
5. Test your application:
a. Insert data into the database.
Enter a name in the text box and click Insert. The name should now appear in the listbox.
b. Update data in the database.
Click a name in the listbox. Enter a new name in the text box. Click Update.
The new name should now appear in place of the old name in the listbox.
c. Delete data from the database.
Results
Task overview: Tutorial: Building a Microsoft Windows Mobile application using UltraLite.NET [page 29]
Following is the complete code for the tutorial program described in the preceding sections.
using Sap.Data.UltraLite;
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace CSApp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private ULConnection Conn;
private int[] ids;
private void Form1_Load(object sender, EventArgs e)
{
try
{
String ConnString = "dbf=\\Program Files\\CSApp\\CSApp.udb";
Conn = new ULConnection(ConnString);
Conn.Open();
Conn.DatabaseID = 1;
RefreshListBox();
}
catch (System.Exception t)
{
MessageBox.Show("Exception: " + t.Message);
}
}
private void RefreshListBox()
{
try
{
long NumRows;
int I = 0;
lbNames.Items.Clear();
using (ULCommand cmd = Conn.CreateCommand())
{
cmd.CommandText = "SELECT ID, Name FROM Names";
using (ULDataReader dr = cmd.ExecuteReader())
{
dr.MoveBeforeFirst();
NumRows = dr.RowCount;
ids = new int[NumRows];
while (dr.MoveNext())
{
lbNames.Items.Add(
dr.GetString(1));
Parent topic: Tutorial: Building a Microsoft Windows Mobile application using UltraLite.NET [page 29]
Previous task: Lesson 5: Building and deploying the application [page 41]
Next: Code listing for Microsoft Visual Basic tutorial [page 45]
Following is the complete code for the tutorial program described in the preceding sections.
Imports Sap.Data.UltraLite
Public Class Form1
Dim Conn As ULConnection
Dim ids() As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Try
Dim ConnString As String = "dbf=\Program Files\VBApp\VBApp.udb"
Conn = New ULConnection(ConnString)
Conn.Open()
Conn.DatabaseID = 1
RefreshListBox()
Catch
MsgBox("Exception: " + Err.Description)
End Try
End Sub
Private Sub RefreshListBox()
Try
Dim cmd As ULCommand = Conn.CreateCommand()
Dim I As Integer = 0
lbNames.Items.Clear()
cmd.CommandText = "SELECT ID, Name FROM Names"
Dim dr As ULDataReader = cmd.ExecuteReader()
ReDim ids(dr.RowCount)
While (dr.MoveNext)
lbNames.Items.Add(dr.GetString(1))
ids(I) = dr.GetInt32(0)
I = I + 1
End While
dr.Close()
txtName.Text = " "
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
Private Sub btnInsert_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnInsert.Click
Try
Dim RowsInserted As Long
Parent topic: Tutorial: Building a Microsoft Windows Mobile application using UltraLite.NET [page 29]
You can write .NET applications for UltraLite by using the API for the UltraLite.NET Data Provider for .NET
Framework 2.0 and .NET Compact Framework 2.0.
The following list describes some of the more commonly-used high level classes for the Sap.Data.UltraLite
namespace:
ULConnection
Each ULConnection object represents a connection to an UltraLite database. You can create one or more
ULConnection objects.
ULTable
Each ULCommand object holds a SQL statement to be executed against the database.
ULDataReader object
Each ULDataReader object holds the result set for a single query.
ULSyncParms
You use the ULSyncParms object to synchronize your UltraLite database with a MobiLink server.
Many of the properties and methods in this chapter are very similar to the .NET Framework Data Provider for
OLE DB (System.Data.OleDb). You can find more information and examples in the Microsoft .NET Framework
documentation.
In this section:
Use the API for the UltraLite.NET Data Provider for .NET Framework 2.0 and .NET Compact Framework 2.0 to
write .NET applications for UltraLite.
Namespace
Sap.Data.UltraLite
To use the UltraLite Engine runtime of UltraLite.NET, set the RuntimeType property to the appropriate value
before using any other UltraLite.NET API.
The assembly uses a satellite resource assembly named Sap.Data.UltraLite.resources. The main assembly
searches for this resource assembly by culture, using the following order:
● CultureInfo.CurrentUICulture
● CultureInfo.CurrentCulture
● EN
In this section:
Syntax
Visual Basic
C#
Members
Methods
public void ActiveSyncInvoked(bool) [page 51] Invoked when the MobiLink provider for
ActiveSync calls the application to per
form synchronization.
In this section:
Invoked when the MobiLink provider for ActiveSync calls the application to perform synchronization.
Syntax
Visual Basic
C#
launchedByProvider True if the application was launched by the MobiLink provider to perform ActiveSync
synchronization. The application must then shut itself down after it has finished synchronizing. False if the
application was already running when called by the MobiLink provider for ActiveSync.
Remarks
This method is invoked by a separate thread. To avoid multi-threading issues, it should post an event to the UI.
If you are using multi-threading, use a separate connection and use the lock keyword to access any objects
shared with the rest of the application.
Example
The following code fragments demonstrate how to receive an ActiveSync request and perform a
synchronization in the UI thread:
// C#
using Sap.Data.UltraLite;
public class Form1 : System.Windows.Forms.Form, ULActiveSyncListener
{
private System.Windows.Forms.MainMenu mainMenu1;
private ULConnection conn;
public Form1()
{
//
// Required for Windows Form Designer support.
// InitializeComponent();
//
// TODO: Add any constructor code after the
// InitializeComponent call.
//
ULDatabaseManager.SetActiveSyncListener(
"myCompany.myapp", this
);
// Create connection
...
}
protected override void Dispose( bool disposing )
{
base.Dispose( disposing );
}
protected override void OnClosing(
System.ComponentModel.CancelEventArgs e )
{
ULDatabaseManager.SetActiveSyncListener(null, null);
base.OnClosing(e);
}
public void ActiveSyncInvoked(bool launchedByProvider)
{
this.Invoke( new EventHandler( ActiveSyncHandler ) );
}
internal void ActiveSyncHandler(object sender, EventArgs e)
{
conn.Synchronize();
ULDatabaseManager.SignalSyncIsComplete();
}
}
Related Information
Syntax
Visual Basic
Members
Methods
public void WriteToServer [page 61] Copies all rows in the supplied array of
System.Data.DataRow objects to a des
tination table specified by the Destina
tionTableName field of the ULBulkCopy
object.
Properties
public int BatchSize [page 64] Gets or sets the number of rows in each
batch.
public int BulkCopyTimeout [page 65] Gets or sets the number of seconds for
the operation to complete before it
times out.
public string DestinationTableName [page 66] Gets or sets the name of the destina
tion table on the server.
Events
public ULRowsCopiedEventHandler ULRowsCopied [page 67] This event occurs every time the num
ber of rows specified by the NotifyAfter
property have been processed.
Remarks
The ULBulkCopy class is not available in the .NET Compact Framework 2.0.
In this section:
Overload list
In this section:
Syntax
Visual Basic
C#
connection The ULConnection object that is used to perform the bulk-copy operation. If the connection is
not open, an exception is thrown during a WriteToServer method call.
Remarks
The ULBulkCopy class is not available in the .NET Compact Framework 2.0.
Related Information
Initializes a ULBulkCopy object with the specified ULConnection object, copy options, and ULTransaction
object.
Syntax
Visual Basic
C#
public ULBulkCopy (
ULConnection connection,
ULBulkCopyOptions copyOptions,
ULTransaction externalTransaction
)
Parameters
connection The ULConnection object that is used to perform the bulk-copy operation. If the connection is
not open, an exception is thrown during a WriteToServer method call.
Remarks
The ULBulkCopy class is not available in the .NET Compact Framework 2.0.
Related Information
Syntax
Visual Basic
C#
Parameters
connectionString The string defining the connection to be opened for use by the ULBulkCopy object. A
connection string is a semicolon-separated list of keyword=value pairs.
Remarks
The ULBulkCopy class is not available in the .NET Compact Framework 2.0.
Related Information
Initializes a ULBulkCopy object with the specified connection string, and copy options.
Syntax
Visual Basic
C#
public ULBulkCopy (
string connectionString,
ULBulkCopyOptions copyOptions
)
Parameters
connectionString The string defining the connection to be opened for use by the ULBulkCopy object. A
connection string is a semicolon-separated list of keyword=value pairs.
copyOptions A combination of values from the ULBulkCopyOptions enumeration that determines how
data source rows are copied to the destination table.
Remarks
The ULBulkCopy class is not available in the .NET Compact Framework 2.0.
Related Information
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
Copies all rows in the supplied array of System.Data.DataRow objects to a destination table specified by the
DestinationTableName field of the ULBulkCopy object.
Overload list
public void WriteToServer(DataRow[]) [page 62] Copies all rows in the supplied array of
System.Data.DataRow objects to a des
tination table specified by the Destina
tionTableName field of the ULBulkCopy
object.
public void WriteToServer(DataTable) [page 62] Copies all rows in the supplied Sys
tem.Data.DataTable to a destination ta
ble specified by the ULBulkCopy.Desti
nationTableName property.
public void WriteToServer(DataTable, DataRow Copies all rows in the supplied Sys
State) [page 63] tem.Data.DataTable with the specified
row state to a destination table speci
fied by the ULBulkCopy.DestinationTa
bleName property.
public void WriteToServer(IDataReader) [page 64] Copies all rows in the supplied Sys
tem.Data.IDataReader to a destination
table specified by the ULBulkCopy.Des
tinationTableName property.
In this section:
Copies all rows in the supplied array of System.Data.DataRow objects to a destination table specified by the
DestinationTableName field of the ULBulkCopy object.
Syntax
Visual Basic
C#
Parameters
Related Information
Copies all rows in the supplied System.Data.DataTable to a destination table specified by the
ULBulkCopy.DestinationTableName property.
Syntax
Visual Basic
C#
Parameters
Copies all rows in the supplied System.Data.DataTable with the specified row state to a destination table
specified by the ULBulkCopy.DestinationTableName property.
Syntax
Visual Basic
C#
Parameters
Remarks
If the rowState parameter is specified, then only those rows that have the same row state are copied.
Related Information
Copies all rows in the supplied System.Data.IDataReader to a destination table specified by the
ULBulkCopy.DestinationTableName property.
Syntax
Visual Basic
C#
Parameters
Related Information
Syntax
Visual Basic
C#
Remarks
At the end of each batch, the rows in the batch are sent to the server.
If this value is changed while a batch is in progress, the current batch completes and any further batches use
the new value.
Gets or sets the number of seconds for the operation to complete before it times out.
Syntax
Visual Basic
C#
Remarks
Setting a value of zero indicates no limit, which should be avoided because it may cause an indefinite wait.
If the operation times out, then all rows in the current transaction are rolled back and an SAException error is
thrown.
Syntax
Visual Basic
C#
Column mappings define the relationships between columns in the data source and columns in the destination.
If the ColumnMappings object is empty when the WriteToServer method is executed, then the first column in
the source is mapped to the first column in the destination, the second is mapped to the second, and so on.
This takes place as long as the column types are convertible, there are at least as many destination columns as
source columns, and any extra destination columns are nullable.
Related Information
Syntax
Visual Basic
C#
Remarks
If the value is changed while a WriteToServer call is executing, the change has no effect.
If the value has not been set before a call to the WriteToServer method, an InvalidOperationException error is
thrown.
It is an error to set the value to null (Nothing in Visual Basic) or the empty string.
Syntax
Visual Basic
C#
Remarks
An integer representing the number of rows to be processed before generating a notification event, or zero is if
the property has not been set.
Changes made to this property, while executing the WriteToServer method, do not take effect until after the
next notification.
Setting this value ta a value that is less than zero throws an error.
The values of NotifyAfter and BulkCopyTimeout properties are mutually exclusive, so the event can fire even if
no rows have been sent to the database or committed.
Related Information
This event occurs every time the number of rows specified by the NotifyAfter property have been processed.
Syntax
Visual Basic
C#
The receipt of a ULRowsCopied event does not imply that any rows have been committed. You cannot call the
Close method from this event.
Related Information
Defines the mapping between a column in a ULBulkCopy instance's data source and a column in the instance's
destination table.
Syntax
Visual Basic
C#
Members
Properties
public string DestinationColumn [page 74] Specifies the name of the column in the
destination database table being map
ped to.
public int DestinationOrdinal [page 75] Specifies the ordinal value of the col
umn in the destination database table
being mapped to.
public string SourceColumn [page 75] Specifies the name of the column being
mapped in the data source.
public int SourceOrdinal [page 76] Specifies the ordinal position of the
source column within the data source.
Remarks
The ULBulkCopyColumnMapping class is not available in the .NET Compact Framework 2.0.
In this section:
Related Information
Overload list
In this section:
Syntax
Visual Basic
C#
public ULBulkCopyColumnMapping ()
The ULBulkCopyColumnMapping class is not available in the .NET Compact Framework 2.0.
Creates a new column mapping, using column ordinals or names to refer to source and destination columns.
Syntax
Visual Basic
C#
public ULBulkCopyColumnMapping (
int sourceColumnOrdinal,
int destinationColumnOrdinal
)
Parameters
sourceColumnOrdinal The ordinal position of the source column within the data source. The first column
in a data source has ordinal position zero.
destinationColumnOrdinal The ordinal position of the destination column within the destination table. The
first column in a table has ordinal position zero.
Remarks
The ULBulkCopyColumnMapping class is not available in the .NET Compact Framework 2.0.
Creates a new column mapping, using a column ordinal to refer to the source column and a column name to
refer to the destination column.
Syntax
Visual Basic
C#
public ULBulkCopyColumnMapping (
int sourceColumnOrdinal,
string destinationColumn
)
Parameters
sourceColumnOrdinal The ordinal position of the source column within the data source. The first column
in a data source has ordinal position zero.
destinationColumn The name of the destination column within the destination table.
Remarks
The ULBulkCopyColumnMapping class is not available in the .NET Compact Framework 2.0.
Creates a new column mapping, using a column name to refer to the source column and a column ordinal to
refer to the destination the column.
Syntax
Visual Basic
C#
public ULBulkCopyColumnMapping (
string sourceColumn,
int destinationColumnOrdinal
)
Parameters
sourceColumn The name of the source column within the data source.
destinationColumnOrdinal The ordinal position of the destination column within the destination table. The
first column in a table has ordinal position zero.
Remarks
The ULBulkCopyColumnMapping class is not available in the .NET Compact Framework 2.0.
Creates a new column mapping, using column names to refer to source and destination columns.
Syntax
Visual Basic
C#
public ULBulkCopyColumnMapping (
string sourceColumn,
string destinationColumn
)
Parameters
sourceColumn The name of the source column within the data source.
Remarks
The ULBulkCopyColumnMapping class is not available in the .NET Compact Framework 2.0.
Specifies the name of the column in the destination database table being mapped to.
Syntax
Visual Basic
C#
Remarks
A string specifying the name of the column in the destination table or a null reference (Nothing in Visual Basic)
if the DestinationOrdinal property has priority.
The DestinationColumn and DestinationOrdinal properties are mutually exclusive. The most recently set value
takes priority.
Setting the DestinationColumn property causes the DestinationOrdinal property to be set to -1. Setting the
DestinationOrdinal property causes the DestinationColumn property to be set to a null reference (Nothing in
Visual Basic).
Related Information
Specifies the ordinal value of the column in the destination database table being mapped to.
Syntax
Visual Basic
C#
Remarks
An integer specifying the ordinal of the column being mapped to in the destination table or -1 if the property is
not set.
The DestinationColumn and DestinationOrdinal properties are mutually exclusive. The most recently set value
takes priority.
Setting the DestinationColumn property causes the DestinationOrdinal property to be set to -1. Setting the
DestinationOrdinal property causes the DestinationColumn property to be set to a null reference (Nothing in
Visual Basic).
Related Information
Specifies the name of the column being mapped in the data source.
Syntax
Visual Basic
C#
A string specifying the name of the column in the data source or a null reference (Nothing in Visual Basic) if the
SourceOrdinal has priority.
The SourceColumn and SourceOrdinal properties are mutually exclusive. The most recently set value takes
priority.
Setting the SourceColumn property causes the SourceOrdinal property to be set to -1. Setting the
SourceOrdinal property causes the SourceColumn property to be set to a null reference (Nothing in Visual
Basic).
Related Information
Specifies the ordinal position of the source column within the data source.
Syntax
Visual Basic
C#
Remarks
An integer specifying the ordinal of the column in the data source or -1 if the property is not set.
The SourceColumn and SourceOrdinal properties are mutually exclusive. The most recently set value takes
priority.
Setting the SourceColumn property causes the SourceOrdinal property to be set to -1. Setting the
SourceOrdinal property causes the SourceColumn property to be set to a null reference (Nothing in Visual
Basic).
Syntax
Visual Basic
C#
Members
public new void RemoveAt(int) [page 87] Removes the mapping at the specified
index from the collection.
Remarks
The ULBulkCopyColumnMappingCollection class is not available in the .NET Compact Framework 2.0.
In this section:
Related Information
Overload list
In this section:
Syntax
Visual Basic
C#
Parameters
Remarks
The ULBulkCopyColumnMappingCollection class is not available in the .NET Compact Framework 2.0.
Related Information
Creates a new ULBulkCopyColumnMapping object using ordinals to specify both source and destination
columns, and adds the mapping to the collection.
Syntax
Visual Basic
C#
Parameters
sourceColumnOrdinal The ordinal position of the source column within the data source. The first column
in a data source has ordinal position zero.
destinationColumnOrdinal The ordinal position of the destination column within the destination table. The
first column in a table has ordinal position zero.
Remarks
The ULBulkCopyColumnMappingCollection class is not available in the .NET Compact Framework 2.0.
Related Information
Creates a new ULBulkCopyColumnMapping object using a column ordinal to refer to the source column and a
column name to refer to the destination column, and adds mapping to the collection.
Syntax
Visual Basic
C#
Parameters
sourceColumnOrdinal The ordinal position of the source column within the data source. The first column
in a data source has ordinal position zero.
destinationColumn The name of the destination column within the destination table.
Remarks
The ULBulkCopyColumnMappingCollection class is not available in the .NET Compact Framework 2.0.
Related Information
Creates a new ULBulkCopyColumnMapping object using a column name to refer to the source column and a
column ordinal to refer to the destination the column, and adds the mapping to the collection.
Syntax
Visual Basic
C#
Parameters
sourceColumn The name of the source column within the data source.
destinationColumnOrdinal The ordinal position of the destination column within the destination table. The
first column in a table has ordinal position zero.
Remarks
Creates a new column mapping, using column ordinals or names to refer to source and destination columns.
The ULBulkCopyColumnMappingCollection class is not available in the .NET Compact Framework 2.0.
Related Information
Creates a new ULBulkCopyColumnMapping object using column names to specify both source and destination
columns, and adds the mapping to the collection.
Syntax
Visual Basic
C#
Parameters
sourceColumn The name of the source column within the data source.
destinationColumn The name of the destination column within the destination table.
Remarks
The ULBulkCopyColumnMappingCollection class is not available in the .NET Compact Framework 2.0.
Related Information
Syntax
Visual Basic
C#
Parameters
Returns
True if the specified mapping exists in the collection; otherwise, returns false.
Related Information
Syntax
Visual Basic
C#
Parameters
array The one-dimensional ULBulkCopyColumnMapping array that is the destination of the elements
copied from this ULBulkCopyColumnMappingCollection object. The array must have zero-based indexing.
index The zero-based index in the array at which copying begins.
Related Information
Returns the index of the specified ULBulkCopyColumnMapping object within the collection.
Syntax
Visual Basic
C#
Parameters
Returns
The zero-based index of the column mapping is returned, or -1 is returned if the column mapping is not found in
the collection.
Syntax
Visual Basic
C#
Parameters
Related Information
Syntax
Visual Basic
C#
index The zero-based index of the ULBulkCopyColumnMapping object to be removed from the collection.
Syntax
Visual Basic
C#
Remarks
Related Information
Syntax
Visual Basic
C#
Methods
public override void Cancel() [page 105] This method is not supported in Ultra
Lite.NET.
public new ULParameter CreateParameter() [page 106] Provides a ULParameter object for sup
plying parameters to ULCommand ob
jects.
protected override void Dispose(bool) [page 106] Releases the unmanaged resources
used by the ULCommand object and
optionally releases the managed re
sources.
public override unsafe int ExecuteNonQuery() [page 114] Executes a statement that does not re
turn a result set, such as a SQL INSERT,
DELETE, or UPDATE statement.
public new ULDataReader ExecuteReader [page 115] Executes a SQL SELECT statement and
returns the result set.
public ULResultSet ExecuteResultSet [page 119] UL Ext: Executes a SQL SELECT state
ment and returns the result set as a UL
ResultSet object.
public override object ExecuteScalar() [page 122] Executes a SQL SELECT statement and
returns a single value.
public override unsafe void Prepare() [page 126] Pre-compiles and stores the SQL state
ment of this command.
Properties
public override string CommandText [page 127] Specifies the text of the SQL statement
or the name of the table when the UL
Command.CommandType property is
System.Data.CommandType.TableDir
ect.
public override int CommandTimeout [page 128] This feature is not supported by Ultra
Lite.NET.
public override CommandType CommandType [page 129] Specifies the type of command to be
executed.
public new ULConnection Connection [page 130] The connection object on which to exe
cute the ULCommand object.
public override bool DesignTimeVisible [page 131] Indicates if the ULCommand object
should be visible in a customized Win
dows Form Designer control.
public string IndexName [page 132] UL Ext: Specifies the name of the index
to open (sort) the table with when the
ULCommand.CommandType property
is System.Data.CommandType.Table
Direct.
public new ULParameterCollection Parameters [page 132] Specifies the parameters for the cur
rent statement.
public unsafe string Plan [page 133] UL Ext: Returns the access plan Ultra
Lite.NET uses to execute a query.
public new ULTransaction Transaction [page 134] Specifies the ULTransaction object in
which the ULCommand object exe
cutes.
public override UpdateRowSource UpdatedRowSource [page 134] Specifies how command results are ap
plied to the DataRow when used by the
ULDataAdapterUpdate method.
This object can be used to execute a statement or query efficiently multiple times.
ULCommand objects can be created directly, or with the ULConnection.CreateCommand method. This method
ensures that the command has the correct transaction for executing statements on the given connection.
The ULCommand.Transaction method must be reset after the current transaction is committed or rolled back.
The ULCommand class features the following methods for executing commands on an UltraLite.NET database:
Method Description
ULCommand.ExecuteNonQuery Executes a statement that does not return a result set, such
as a SQL INSERT, DELETE, or UPDATE statement.
ULCommand.ExecuteReader() Executes a SQL SELECT statement and returns the result set
in a ULDataReader object. Use this method for creating
read-only result sets.
You can reset most properties, including the ULCommand.CommandText property, and reuse the ULCommand
object.
For resource management reasons, you should explicitly dispose of commands when you are done with them.
In C#, you may use a using statement to automatically call the System.ComponentModel.Component.Dispose
method or explicitly call the System.ComponentModel.Component.Dispose method. In Visual Basic, you
always explicitly call the System.ComponentModel.Component.Dispose method.
In this section:
Related Information
Overload list
In this section:
Syntax
Visual Basic
C#
public ULCommand ()
Remarks
Related Information
Syntax
Visual Basic
C#
Parameters
cmdText The text of the SQL statement or name of the table when the ULCommand.CommandType
property is System.Data.CommandType.TableDirect. For parameterized statements, use a question mark
(?) placeholder to pass parameters.
Remarks
The ULCommand object needs to have the ULCommand.Connection and ULCommand.Transaction properties
set before a statement can be executed.
Related Information
Initializes a ULCommand object with the specified command text and connection.
Syntax
Visual Basic
C#
public ULCommand (
string cmdText,
ULConnection connection
)
Parameters
cmdText The text of the SQL statement or name of the table when the ULCommand.CommandType
property is System.Data.CommandType.TableDirect. For parameterized statements, use a question mark
(?) placeholder to pass parameters.
connection The ULConnection object representing the current connection.
Remarks
The ULCommand object may need to have the ULCommand.Transaction property set before a statement can
be executed.
Related Information
Initializes a ULCommand object with the specified command text, connection, and transaction.
Syntax
Visual Basic
C#
public ULCommand (
string cmdText,
ULConnection connection,
ULTransaction transaction
)
Parameters
cmdText The text of the SQL statement or name of the table when the ULCommand.CommandType
property is System.Data.CommandType.TableDirect. For parameterized statements, use a question mark
(?) placeholder to pass parameters.
connection The ULConnection object representing the current connection.
transaction The ULTransaction object in which the ULCommand object executes.
Related Information
Initiates the asynchronous execution of a SQL statement that is described by this ULCommand object.
Overload list
In this section:
Initiates the asynchronous execution of a SQL statement that is described by this ULCommand object.
Syntax
Visual Basic
C#
Returns
A System.IAsyncResult that can be used to poll, wait for results, or both is returned; this value is also needed
when invoking the EndExecuteNonQuery(IAsyncResult) method, which returns the number of affected rows.
ULException class Any error that occurred while executing the command text.
Related Information
Initiates the asynchronous execution of a SQL statement that is described by this ULCommand object, given a
callback procedure and state information.
Syntax
Visual Basic
C#
Parameters
callback A System.AsyncCallback delegate that is invoked when the command's execution has completed.
Pass null (Nothing in Microsoft Visual Basic) to indicate that no callback is required.
stateObject A userdefined state object that is passed to the callback procedure. Retrieve this object from
within the callback procedure using the System.IAsyncResult.AsyncState property.
Returns
A System.IAsyncResult that can be used to poll, wait for results, or both is returned; this value is also needed
when invoking the EndExecuteNonQuery(IAsyncResult) method, which returns the number of affected rows.
ULException class Any error that occurred while executing the command text.
Related Information
Initiates the asynchronous execution of a SQL statement that is described by this ULCommand object, and
retrieves the result set.
Overload list
In this section:
Initiates the asynchronous execution of a SQL statement that is described by this ULCommand object, and
retrieves the result set.
Syntax
Visual Basic
C#
Returns
An System.IAsyncResult that can be used to poll, wait for results, or both is returned; this value is also needed
when invoking the EndExecuteReader(IAsyncResult) method, which returns an ULDataReader object that can
be used to retrieve the returned rows.
Exceptions
ULException class Any error that occurred while executing the command text.
Related Information
Initiates the asynchronous execution of a SQL statement that is described by this ULCommand object, and
retrieves the result set, given a callback procedure and state information.
Syntax
Visual Basic
C#
Parameters
callback An System.AsyncCallback delegate that is invoked when the command's execution has
completed. Pass null (Nothing in Microsoft Visual Basic) to indicate that no callback is required.
stateObject A userdefined state object that is passed to the callback procedure. Retrieve this object from
within the callback procedure using the System.IAsyncResult.AsyncState property.
Returns
A System.IAsyncResult that can be used to poll, wait for results, or both is returned; this value is also needed
when invoking the EndExecuteReader(IAsyncResult) method, which returns a ULDataReader object that can
be used to retrieve the returned rows.
Exceptions
ULException class Any error that occurred while executing the command text.
Related Information
Initiates the asynchronous execution of a SQL statement that is described by this ULCommand object, using
one of the CommandBehavior values, and retrieves the result set, given a callback procedure and state
information.
Syntax
Visual Basic
C#
Parameters
callback A System.AsyncCallback delegate that is invoked when the command's execution has completed.
Pass null (Nothing in Microsoft Visual Basic) to indicate that no callback is required.
stateObject A userdefined state object that is passed to the callback procedure. Retrieve this object from
within the callback procedure using the System.IAsyncResult.AsyncState property.
cmdBehavior A bitwise combination of System.Data.CommandBehavior flags describing the results of the
query and its effect on the connection. UltraLite.NET respects only the
System.Data.CommandBehavior.Default, System.Data.CommandBehavior.CloseConnection, and
System.Data.CommandBehavior.SchemaOnly flags.
Returns
A System.IAsyncResult that can be used to poll, wait for results, or both is returned; this value is also needed
when invoking the EndExecuteReader(IAsyncResult) method, which returns a ULDataReader object that can
be used to retrieve the returned rows.
ULException class Any error that occurred while executing the command text.
Related Information
Initiates the asynchronous execution of a SQL statement that is described by this ULCommand object, using
one of the CommandBehavior values, and retrieves the result set.
Syntax
Visual Basic
C#
Parameters
Returns
An System.IAsyncResult that can be used to poll, wait for results, or both is returned; this value is also needed
when invoking the EndExecuteReader(IAsyncResult) method, which returns a ULDataReader object that can
be used to retrieve the returned rows.
ULException class Any error that occurred while executing the command text.
Related Information
Syntax
Visual Basic
C#
Remarks
This method does nothing. UltraLite.NET commands cannot be interrupted while they are executing.
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
Returns
Remarks
Some SQL statements can take parameters, indicated in the text of a statement by a question mark (?). The
CreateParameter method provides a ULParameter object. You can set properties on the ULParameter object to
specify the value for the parameter.
Related Information
Releases the unmanaged resources used by the ULCommand object and optionally releases the managed
resources.
Syntax
Visual Basic
Parameters
disposing When true, disposes of both the managed and unmanaged resources. When false, disposes of
only the unmanaged resources.
Syntax
Visual Basic
C#
Parameters
Returns
The number of rows affected, which is the same behavior as the ExecuteNonQuery method.
Exceptions
You must call the EndExecuteNonQuery method once for every BeginExecuteNonQuery call. The call must be
made after the BeginExecuteNonQuery call returns. ADO.NET is not thread safe; you must ensure that the
BeginExecuteNonQuery call has returned. The System.IAsyncResult passed to the EndExecuteNonQuery
method must be the same as the one returned from the BeginExecuteNonQuery call that is being completed. It
is an error to call the EndExecuteNonQuery method to end a call to the BeginExecuteReader method, and vice
versa.
If an error occurs while executing the command, the exception is thrown when the EndExecuteNonQuery
method is called.
Call EndExecuteNonQuery Calling EndExecuteNonQuery blocks until the command completes. For example:
// C#
ULCommand cmd = new ULCommand(
"UPDATE Departments"
+ " SET DepartmentName = 'Engineering'"
+ " WHERE DepartmentID=100",
conn
);
IAsyncResult res = cmd.BeginExecuteNonQuery();
// Perform other work.
// This blocks until the command completes.
int rowCount = cmd.EndExecuteNonQuery( res );
Poll the IsCompleted property of the IAsyncResult You can poll the IsCompleted property of the
IAsyncResult. For example:
// C#
ULCommand cmd = new ULCommand(
"UPDATE Departments"
+ " SET DepartmentName = 'Engineering'"
+ " WHERE DepartmentID=100",
conn
);
IAsyncResult res = cmd.BeginExecuteNonQuery();
while( !res.IsCompleted ) {
// Perform other work.
}
// This blocks until the command completes.
int rowCount = cmd.EndExecuteNonQuery( res );
Use the IAsyncResult.AsyncWaitHandle property to get a synchronization object You can use the
IAsyncResult.AsyncWaitHandle property to get a synchronization object, and wait on that. For example:
// C#
ULCommand cmd = new ULCommand(
"UPDATE Departments"
+ " SET DepartmentName = 'Engineering'"
+ " WHERE DepartmentID=100",
conn
);
IAsyncResult res = cmd.BeginExecuteNonQuery();
// perform other work
WaitHandle wh = res.AsyncWaitHandle;
wh.WaitOne();
// This does not block because the command is finished.
int rowCount = cmd.EndExecuteNonQuery( res );
Specify a callback function when calling the BeginExecuteNonQuery method You can specify a callback
function when calling the BeginExecuteNonQuery method. For example:
// C#
private void callbackFunction( IAsyncResult ar )
{
ULCommand cmd = (ULCommand) ar.AsyncState;
// This won't block since the command has completed.
int rowCount = cmd.EndExecuteNonQuery();
}
// Elsewhere in the code
private void DoStuff()
{
ULCommand cmd = new ULCommand(
"UPDATE Departments"
+ " SET DepartmentName = 'Engineering'"
+ " WHERE DepartmentID=100",
conn
);
IAsyncResult res = cmd.BeginExecuteNonQuery(
callbackFunction, cmd
);
// Perform other work. The callback function
// is called when the command completes.
}
The callback function executes in a separate thread, so the usual caveats related to updating the user interface
in a threaded program apply.
Related Information
Syntax
Visual Basic
C#
Parameters
Returns
An ULDataReader object that can be used to retrieve the requested rows, which is the same behavior as the
ExecuteReader method.
Exceptions
Remarks
You must call the EndExecuteReader method once for every call to the BeginExecuteReader method. The call
must be after the BeginExecuteReader call returns. ADO.NET is not thread safe; it is your responsibility to
ensure that the BeginExecuteReader method has returned. The System.IAsyncResult passed to the
EndExecuteReader method must be the same as the one returned from the BeginExecuteReader call that is
being completed. It is an error to call the EndExecuteReader method to end a BeginExecuteNonQuery call, and
vice versa.
If an error occurs while executing the command, the exception is thrown when the EndExecuteReader method
is called.
Call the EndExecuteReader method Calling the EndExecuteReader method blocks until the command
completes. For example:
// C#
ULCommand cmd = new ULCommand(
"SELECT * FROM Departments", conn
);
IAsyncResult res = cmd.BeginExecuteReader();
// Perform other work
// This blocks until the command completes
ULDataReader reader = cmd.EndExecuteReader( res );
Poll the IsCompleted property of the IAsyncResult You can poll the IsCompleted property of the
IAsyncResult. For example:
Use the IAsyncResult.AsyncWaitHandle property to get a synchronization object You can use the
IAsyncResult.AsyncWaitHandle property to get a synchronization object, and wait on that. For example:
// C#
ULCommand cmd = new ULCommand(
"SELECT * FROM Departments", conn
);
IAsyncResult res = cmd.BeginExecuteReader();
// Perform other work.
WaitHandle wh = res.AsyncWaitHandle;
wh.WaitOne();
// This does not block because the command is finished.
ULDataReader reader = cmd.EndExecuteReader( res );
Specify a callback function when calling the BeginExecuteReader method You can specify a callback function
when calling the BeginExecuteReader method. For example:
// C#
private void callbackFunction( IAsyncResult ar )
{
ULCommand cmd = (ULCommand) ar.AsyncState;
// This won't block since the command has completed.
ULDataReader reader = cmd.EndExecuteReader();
}
// Elsewhere in the code.
private void DoStuff()
{
ULCommand cmd = new ULCommand(
"SELECT * FROM Departments", conn
);
IAsyncResult res = cmd.BeginExecuteReader(callbackFunction, cmd);
// Perform other work. The callback function
// is called when the command completes.
}
The callback function executes in a separate thread, so the usual caveats related to updating the user interface
in a threaded program apply.
Syntax
Visual Basic
C#
Executes a statement that does not return a result set, such as a SQL INSERT, DELETE, or UPDATE statement.
Syntax
Visual Basic
C#
Returns
Exceptions
Remarks
The statement is the current ULCommand object, with the ULCommand.CommandText and
ULCommand.Parameters values as required.
For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the
command. For all other types of statements, and for rollbacks, the return value is -1.
Related Information
Overload list
public new ULDataReader ExecuteReader() [page 116] Executes a SQL SELECT statement and
returns the result set.
In this section:
Syntax
Visual Basic
C#
Returns
Exceptions
Remarks
The statement is the current ULCommand object, with the ULCommand.CommandText and any
ULCommand.Parameters values as required. The ULDataReader object is a read-only result set. For editable
result sets, use the ULCommand.ExecuteResultSet method, the ULCommand.ExecuteTable method, or a
ULDataAdapter object.
SELECT statements are marked as read-only by default for performance reasons. If the query is going to be
used to make updates, the statement must end with " FOR UPDATE".
Related Information
Executes a SQL SELECT statement with the specified command behavior and returns the result set.
Syntax
Visual Basic
C#
Parameters
Exceptions
Remarks
The statement is the current ULCommand object, with the ULCommand.CommandText and any
ULCommand.Parameters values as required. The ULDataReader object is a read-only result set. For editable
result sets, use the ULCommand.ExecuteResultSet(CommandBehavior) method, the
ULCommand.ExecuteTable(CommandBehavior) method, or a ULDataAdapter object.
SELECT statements are marked as read-only by default for performance reasons. If the query is going to be
used to make updates, the statement must end with " FOR UPDATE".
Related Information
UL Ext: Executes a SQL SELECT statement and returns the result set as a ULResultSet object.
Overload list
public ULResultSet ExecuteResultSet() [page 119] UL Ext: Executes a SQL SELECT state
ment and returns the result set as a UL
ResultSet object.
In this section:
UL Ext: Executes a SQL SELECT statement and returns the result set as a ULResultSet object.
Syntax
Visual Basic
C#
Returns
Remarks
The statement is the current ULCommand object, with the ULCommand.CommandText and any
ULCommand.Parameters values as required. The ULResultSet object is an editable result set on which you can
perform positioned updates and deletes. For fully editable result sets, use the ULCommand.ExecuteTable
method or a ULDataAdapter object.
This method supports positioned updates and deletes with Dynamic SQL.
Example
Related Information
UL Ext: Executes a SQL SELECT statement with the specified command behavior and returns the result set as
a ULResultSet object.
Syntax
Visual Basic
C#
Parameters
Returns
Exceptions
Remarks
The statement is the current ULCommand object, with the ULCommand.CommandText value and any
ULCommand.Parameters value as required. The ULResultSet object is an editable result set on which you can
perform positioned updates and deletes. For fully editable result sets, use the
ULCommand.ExecuteTable(CommandBehavior) method or a ULDataAdapter object.
This method supports positioned updates and deletes with Dynamic SQL.
Related Information
Syntax
Visual Basic
C#
Returns
The first column of the first row in the result set, or a null reference (Nothing in Visual Basic) if the result set is
empty.
Exceptions
Remarks
The statement is the current ULCommand object, with the ULCommand.CommandText value and any
ULCommand.Parameters value as required.
If this method is called on a query that returns multiple rows and columns, only the first column of the first row
is returned.
SELECT statements are marked as read-only by default for performance reasons. If the query is going to be
used to make updates, the statement must end with " FOR UPDATE".
Related Information
Overload list
Syntax
Visual Basic
C#
Returns
Exceptions
Remarks
The ULCommand.CommandText value is interpreted as the name of the table, and ULCommand.IndexName
value can be used to specify a table sorting order.
If the ULCommand.IndexName value is a null reference (Nothing in Visual Basic), the primary key is used to
open the table. Otherwise, the table is opened using the ULCommand.IndexName value as the name of the
index by which to sort.
UL Ext: Retrieves, with the specified command behavior, a database table for direct manipulation.
Syntax
Visual Basic
C#
Parameters
Returns
Exceptions
Remarks
The ULCommand.CommandText value is interpreted as the name of the table, and ULCommand.IndexName
value can be used to specify a table sorting order.
If the ULCommand.IndexName value is a null reference (Nothing in Visual Basic), the primary key is used to
open the table. Otherwise, the table is opened using the ULCommand.IndexName value as the name of the
index by which to sort.
Related Information
Syntax
Visual Basic
C#
Exceptions
Remarks
Pre-compiling statements allows for the efficient re-use of statements when just the parameter values are
changed. Changing any other property on this command unprepares the statement.
UltraLite.NET does not require you to explicitly prepare statements as all unprepared commands are prepared
on calls to the various Execute methods.
Related Information
Specifies the text of the SQL statement or the name of the table when the ULCommand.CommandType
property is System.Data.CommandType.TableDirect.
Syntax
Visual Basic
C#
Remarks
For parameterized statements, use a question mark (?) placeholder to pass parameters.
A string specifying the text of the SQL statement or the name of the table. The default is an empty string
(invalid command).
SELECT statements are marked as read-only by default for performance reasons. If the query is going to be
used to make updates, the statement must end with " FOR UPDATE".
' Visual Basic myCmd.CommandText = "SELECT * FROM Customers WHERE CustomerID = ?"
// C#
myCmd.CommandText = "SELECT * FROM Customers WHERE CustomerID = ?";
Related Information
Syntax
Visual Basic
C#
Remarks
Syntax
Visual Basic
C#
Remarks
Related Information
Syntax
Visual Basic
C#
Remarks
ULCommand objects must have an open connection before they can be executed.
Related Information
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
Indicates if the ULCommand object should be visible in a customized Windows Form Designer control.
Syntax
Visual Basic
C#
Remarks
True if this ULCommand object should be visible, false if this object should not be visible. The default is false.
UL Ext: Specifies the name of the index to open (sort) the table with when the ULCommand.CommandType
property is System.Data.CommandType.TableDirect.
Syntax
Visual Basic
C#
Remarks
A string specifying the name of the index. The default is a null reference (Nothing in Visual Basic), meaning the
table is opened with its primary key.
Related Information
Syntax
Visual Basic
C#
A ULParameterCollection object holding the parameters of the SQL statement. The default value is the empty
collection.
Use question marks in ULCommand.CommandText property value to indicate parameters. The parameters in
the collection are specified in the same order as the question mark placeholders. For example, the first
parameter in the collection corresponds to the first question mark in the SQL statement, the second parameter
in the collection corresponds to the second question mark in the SQL statement, and so on. There must be at
least as many question marks in the ULCommand.CommandText property as there are parameters in this
collection.
Related Information
Syntax
Visual Basic
C#
Remarks
Syntax
Visual Basic
C#
Remarks
The ULTransaction object in which the ULCommand object executes. This should be the current transaction of
the connection specified by the ULCommand.Connection object. The default is a null reference (Nothing in
Visual Basic).
If a command is reused after a transaction has been committed or rolled back, this property needs to be reset.
Related Information
Specifies how command results are applied to the DataRow when used by the ULDataAdapterUpdate method.
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
Members
Constructors
Methods
public new ULCommand GetDeleteCommand [page 140] Gets the automatically generated UL
Command object required to perform
deletions on the database.
public new ULCommand GetInsertCommand [page 143] Gets the automatically generated UL
Command object required to perform
insertions on the database.
public new ULCommand GetUpdateCommand [page 147] Gets the automatically generated UL
Command object required to perform
updates on the database.
Properties
public new ULDataAdapter DataAdapter [page 150] Gets or sets a ULDataAdapter object
for which SQL statements are automat
ically generated.
Remarks
The ULDataAdapter object does not automatically generate the SQL statements required to reconcile changes
made to a System.Data.DataSet with the associated data source. However, you can create a
ULCommandBuilder object to automatically generate SQL statements for single-table updates if you set the
SelectCommand property of the ULDataAdapter object. Then, any additional SQL statements that you do not
set are generated by the ULCommandBuilder object.
Example
The following example uses the ULCommand object, along with the ULDataAdapter and ULConnection
objects, to select rows from a data source. The example is passed a connection string, a query string that is
a SQL SELECT statement, and a string that is the name of the database table. The example then creates a
ULCommandBuilder object.
// C#
public static DataSet SelectULRows(string connectionString,
string queryString, string tableName)
In this section:
Related Information
Overload list
In this section:
Syntax
Visual Basic
C#
public ULCommandBuilder ()
Related Information
Syntax
Visual Basic
C#
Parameters
Related Information
Syntax
Visual Basic
C#
Gets the automatically generated ULCommand object required to perform deletions on the database.
Overload list
public new ULCommand GetDeleteCommand() [page 140] Gets the automatically generated UL
Command object required to perform
deletions on the database.
public new ULCommand GetDeleteCommand(bool) [page 141] Gets the automatically generated UL
Command object required to perform
deletions on the database.
In this section:
Gets the automatically generated ULCommand object required to perform deletions on the database.
Syntax
Visual Basic
C#
Returns
Remarks
After the SQL statement is first generated, the application must explicitly call the
DbCommandBuilder.RefreshSchema method if it changes the ULDataAdapter.SelectCommand value in any
way. Otherwise, the GetDeleteCommand method still uses information from the previous statement, which
might not be correct. The SQL statements are first generated when the application calls either the
DbDataAdapter.Update(System.Data.DataSet) or GetDeleteCommand methods.
Related Information
Gets the automatically generated ULCommand object required to perform deletions on the database.
Syntax
Visual Basic
C#
Returns
Exceptions
Remarks
After the SQL statement is first generated, the application must explicitly call the
DbCommandBuilder.RefreshSchema method if it changes the ULDataAdapter.SelectCommand value in any
way. Otherwise, the GetDeleteCommand method still uses information from the previous statement, which
might not be correct. The SQL statements are first generated when the application calls either the
DbDataAdapter.Update(System.Data.DataSet) or GetDeleteCommand methods.
Related Information
Gets the automatically generated ULCommand object required to perform insertions on the database.
Overload list
public new ULCommand GetInsertCommand() [page 143] Gets the automatically generated UL
Command object required to perform
insertions on the database.
public new ULCommand GetInsertCommand(bool) [page 144] Gets the automatically generated UL
Command object required to perform
insertions on the database.
In this section:
Gets the automatically generated ULCommand object required to perform insertions on the database.
Syntax
Visual Basic
C#
Returns
Remarks
After the SQL statement is first generated, the application must explicitly call the
DbCommandBuilder.RefreshSchema method if it changes the ULDataAdapter.SelectCommand value in any
way. Otherwise, the GetInsertCommand method still uses information from the previous statement, which
might not be correct. The SQL statements are first generated when the application calls either the
DbDataAdapter.Update(System.Data.DataSet) or GetInsertCommand methods.
Related Information
Gets the automatically generated ULCommand object required to perform insertions on the database.
Syntax
Visual Basic
C#
Parameters
Exceptions
Remarks
After the SQL statement is first generated, the application must explicitly call the
DbCommandBuilder.RefreshSchema method if it changes the ULDataAdapter.SelectCommand value in any
way. Otherwise, the GetInsertCommand method still uses information from the previous statement, which
might not be correct. The SQL statements are first generated when the application calls either the
DbDataAdapter.Update(System.Data.DataSet) or GetInsertCommand methods.
Related Information
Overload list
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
Gets the automatically generated ULCommand object required to perform updates on the database.
Overload list
public new ULCommand GetUpdateCommand() [page 147] Gets the automatically generated UL
Command object required to perform
updates on the database.
public new ULCommand GetUpdateCommand(bool) [page 148] Gets the automatically generated UL
Command object required to perform
updates on the database.
In this section:
Gets the automatically generated ULCommand object required to perform updates on the database.
Syntax
Visual Basic
C#
Returns
Remarks
After the SQL statement is first generated, the application must explicitly call the
DbCommandBuilder.RefreshSchema method if it changes the ULDataAdapter.SelectCommand value in any
way. Otherwise, the GetUpdateCommand method still uses information from the previous statement, which
might not be correct. The SQL statements are first generated when the application calls either the
DbDataAdapter.Update(System.Data.DataSet) or GetUpdateCommand methods.
Related Information
Gets the automatically generated ULCommand object required to perform updates on the database.
Syntax
Visual Basic
C#
Returns
Exceptions
Remarks
After the SQL statement is first generated, the application must explicitly call the
DbCommandBuilder.RefreshSchema if it changes the ULDataAdapter.SelectCommand in any way. Otherwise,
the GetUpdateCommand method still uses information from the previous statement, which might not be
correct. The SQL statements are first generated when the application calls either the
DbDataAdapter.Update(System.Data.DataSet) or GetUpdateCommand methods.
Related Information
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
Gets or sets a ULDataAdapter object for which SQL statements are automatically generated.
Syntax
Visual Basic
C#
Remarks
A ULDataAdapter object.
Syntax
Visual Basic
C#
Members
Variables
Constructors
Methods
public unsafe int CancelGetNotification(string) [page UL Ext: Cancels any pending getnotifi
166] cation calls on all queues matching the
given name.
public override void ChangeDatabase(string) [page 168] Changes the current database for an
open connection.
public static void ChangePassword(string, string) [page Changes the password for the user indi
169] cated in the connection string to the
supplied new password.
public override void Close() [page 170] Closes the database connection.
public unsafe long CountUploadRows(string, long) [page UL Ext: Returns the number of rows
171] that need to be uploaded when the next
synchronization takes place.
public new ULCommand CreateCommand() [page 172] Creates and initializes a ULCommand
object associated with this connection
and its current transaction.
protected override unsafe void Dispose(bool) [page 176] Releases the unmanaged resources
used by the ULCommand object and
optionally releases the managed re
sources.
public unsafe DateTime GetLastDownloadTime(string) [page UL Ext: Returns the time of the most re
183] cent download of the specified publica
tion.
public unsafe Guid GetNewUUID() [page 184] UL Ext: Generates a new UUID (Sys
tem.Guid).
public string GetNotification(string, int) [page 184] UL Ext: Blocks for a notification or time
out.
public override DataTable GetSchema [page 187] Returns the list of supported schema
collections.
public override void Open() [page 192] Opens a connection to a database using
the previouslyspecified connection
string.
public void RegisterForEvent(string, string, string, UL Ext: Registers a queue to get events
bool) [page 192] from an object.
public void ResetLastDownloadTime(string) [page UL Ext: Resets the time of the most re
194] cent download.
public void RollbackPartialDownload() [page 195] UL Ext: Rolls back outstanding changes
to the database from a partial down
load.
public unsafe int SendNotification(string, string, string) UL Ext: Sends a notification to match
[page 196] ing queues.
public void Synchronize [page 200] UL Ext: Synchronizes the database us
ing the current ULConnection.Syn
cParms object.
public unsafe int TriggerEvent(string, string) [page 202] UL Ext: Triggers an event.
public void ValidateDatabase [page 203] UL Ext: Performs validation on the cur
rent database.
Properties
public override string ConnectionString [page 206] Specifies the parameters to use for
opening a connection to an Ultra
Lite.NET database.
public override int ConnectionTimeout [page 207] This feature is not supported by Ultra
Lite.NET.
public override string Database [page 207] Returns the name of the database to
which the connection opens.
public unsafe long DatabaseID [page 208] UL Ext: Specifies the Database ID value
to be used for global autoincrement col
umns.
public override string DataSource [page 209] This feature is not supported by Ultra
Lite.NET.
public unsafe short GlobalAutoIncrementUsage [page 209] UL Ext: Returns the percentage of avail
able global autoincrement values that
have been used.
public unsafe ulong LastIdentity [page 210] UL Ext: Returns the most recent iden
tity value used.
public ULDatabaseSchema Schema [page 210] UL Ext: Provides access to the schema
of the current database associated with
this connection.
public override string ServerVersion [page 211] This feature is not supported by Ultra
Lite.NET.
public override ConnectionState State [page 212] Returns the current state of the con
nection.
public ULSyncResult SyncResult [page 213] UL Ext: Returns the results of the last
synchronization for this connection.
Events
public override StateChangeEventHan StateChange [page 215] Occurs when this connection changes
dler state.
Remarks
To use the UltraLite Engine runtime of UltraLite.NET, set the ULDatabaseManager.RuntimeType property to the
appropriate value before using any other UltraLite.NET API.
You must open a connection before carrying out any other operation, and you must close the connection after
you have finished all operations on the connection and before your application terminates. In addition, you
must close all result sets and tables opened on a connection before closing the connection.
In this section:
Related Information
Overload list
In this section:
Syntax
Visual Basic
C#
public ULConnection ()
Remarks
The connection must be opened before you can perform any operations against the database.
To use the UltraLite Engine runtime of UltraLite.NET, set ULDatabaseManager.RuntimeType property to the
appropriate value before using any other UltraLite.NET API.
The ULConnection object needs to have the ULConnection.ConnectionString property set before it can be
opened.
Related Information
Syntax
Visual Basic
C#
Parameters
Exceptions
Remarks
The connection must be opened before you can perform any operations against the database.
To use the UltraLite Engine runtime of UltraLite.NET, set the ULDatabaseManager.RuntimeType property to the
appropriate value before using any other UltraLite.NET API.
Example
The following code creates and opens a connection to the existing database \UltraLite\MyDatabase.udb on
a Windows Mobile device.
// C#
Related Information
Syntax
Visual Basic
C#
UL Ext: Asynchronously launches a synchronization using the current the SyncParms object.
Overload list
In this section:
UL Ext: Asynchronously launches a synchronization using the current the SyncParms object.
Syntax
Visual Basic
C#
Returns
An IAsyncResult object that can be used to determine if the sync has completed or block until the sync has
finished.
Exceptions
Remarks
This method will create a new thread to do the synchronization and then return immediately. Call the
EndSynchronize method to block until the sync has completed.
4.1.7.3.2 BeginSynchronize(Control,
ULSyncProgressedDlg, object) method
Syntax
Visual Basic
C#
Parameters
Returns
An IAsyncResult object that can be used to determine if the sync has completed or block until the sync has
finished.
Remarks
This method creates a new thread to do the synchronization and then return immediately, invoking the
provided ULSyncProgressedDlg method regularly with synchronization progress updates. Call EndSynchronize
to block until the sync has completed.
Related Information
Overload list
public new ULTransaction BeginTransaction(IsolationLevel) [page Returns a transaction object with the
165] specified isolation level.
In this section:
Syntax
Visual Basic
C#
Returns
Exceptions
Remarks
Commands associated with a transaction object are executed as a single transaction. The transaction is
terminated with the ULTransaction.Commit or ULTransaction.Rollback methods.
To associate a command with a transaction object, use the ULCommand.Transaction property. The current
transaction is automatically associated to commands created by the ULConnection.CreateCommand method.
By default, the connection does not use transactions and all commands are automatically committed as they
are executed. Once the current transaction is committed or rolled back, the connection reverts to auto commit
mode and the previous isolation level until the next call to BeginTransaction method.
UltraLite's definition of each isolation level is slightly different than ADO.NET's documentation of IsolationLevel.
Syntax
Visual Basic
C#
Parameters
isolationLevel The required isolation level for the transaction. UltraLite.NET only supports the
System.Data.IsolationLevel.ReadUncommitted and ReadCommitted values.
Returns
Exceptions
ULException class The connection is closed or an unsupported isolation level was specified.
InvalidOperationException The ULConnection class does not support parallel transactions.
Commands associated with a transaction object are executed as a single transaction. The transaction is
terminated with the ULTransaction.Commit or ULTransaction.Rollback methods.
To associate a command with a transaction object, use the ULCommand.Transaction property. The current
transaction is automatically associated to commands created by the ULConnection.CreateCommand method.
By default, the connection does not use transactions and all commands are automatically committed as they
are executed. Once the current transaction is committed or rolled back, the connection reverts to auto commit
mode and the previous isolation level until the next call to the BeginTransaction method.
UltraLite's definition of each isolation level is slightly different than ADO.NET's documentation of IsolationLevel.
Related Information
UL Ext: Cancels any pending getnotification calls on all queues matching the given name.
Syntax
Visual Basic
C#
Parameters
The number of affected queues (not the number of blocked reads necessarily).
Exceptions
Remarks
This method cancels any pending getnotification calls on all queues matching the given name.
Related Information
Syntax
Visual Basic
C#
Parameters
This method will inform the synchronization thread to terminate and returns immediately. Call the
EndSynchronize method to block until the sync has successfully terminated.
Related Information
Syntax
Visual Basic
C#
Parameters
Remarks
The connection to the current database is closed even if there are parameter errors.
Related Information
UL Ext: Changes the database's encryption key to the specified new key.
Syntax
Visual Basic
C#
Parameters
Exceptions
Remarks
Related Information
Changes the password for the user indicated in the connection string to the supplied new password.
Syntax
Visual Basic
C#
Parameters
connectionString The connection string that contains enough information to connect to the database that
you want. The connection string may contain the user ID and the current password.
newPassword The new password to set.
Exceptions
Syntax
Visual Basic
C#
Exceptions
The Close method rolls back any pending transactions and then closes the connection. An application can call
this method multiple times.
UL Ext: Returns the number of rows that need to be uploaded when the next synchronization takes place.
Syntax
Visual Basic
C#
Parameters
Returns
The number of rows that need to be uploaded from the specified publication(s).
Exceptions
Creates and initializes a ULCommand object associated with this connection and its current transaction.
Syntax
Visual Basic
C#
Returns
Remarks
You can use the properties of the ULCommand object to control its behavior.
You must set the ULCommand.CommandText property before the command can be executed.
Related Information
Syntax
Visual Basic
Syntax
Visual Basic
C#
Parameters
Exceptions
Remarks
This method create an event notification queue for this connection. Queue names are scoped per-connection,
so different connections can create queues with the same name. When an event notification is sent, all queues
in the database with a matching name receive (a separate instance of) the notification. Names are case
insensitive. A default queue is created on demand for each connection when calling the RegisterForEvent event
if no queue is specified.
Syntax
Visual Basic
C#
Parameters
Exceptions
Remarks
Declare an event which can then be registered for and triggered. UltraLite predefines some system events
triggered by operations on the database or the environment. The event name must be unique. Names are case
insensitive. Throws error if name already used or invalid
Related Information
Syntax
Visual Basic
C#
Parameters
Exceptions
Remarks
Destroy the given event notification queue. A warning is signaled if unread notifications remain in the queue.
Unread notifications are discarded. A connection's default event queue, if created, is destroyed when the
connection is closed.
Related Information
Releases the unmanaged resources used by the ULCommand object and optionally releases the managed
resources.
Syntax
Visual Basic
C#
Parameters
disposing When true, dispose of both managed and unmanaged resources. When false, dispose of only the
unmanaged resources.
Syntax
Visual Basic
C#
Parameters
Exceptions
Related Information
Overload list
public ULTable ExecuteTable(string, string) [page 179] UL Ext: Retrieves a database table in a
ULTable object for direct manipulation.
public ULTable ExecuteTable(string, string, Command UL Ext: Retrieves, with the specified
Behavior) [page 181] command behavior, a database table
for direct manipulation.
In this section:
Syntax
Visual Basic
C#
Parameters
Returns
Exceptions
Remarks
This method is a shortcut for the ULCommand.ExecuteTable method that does not require a ULCommand
object. It is provided to help users porting from earlier versions of UltraLite.NET (it replaces
Sap.UltraLite.Connection.GetTable and Sap.UltraLite.Table.Open methods).
Example
The following code opens the table named MyTable using the table's primary key. It assumes an open
ULConnection instance called conn.
// C#
ULTable t = conn.ExecuteTable("MyTable");
// The line above is equivalent to
// ULTable t;
// using(ULCommand cmd = conn.CreateCommand())
// {
// cmd.CommandText = "MyTable";
// cmd.CommandType = CommandType.TableDirect;
// t = cmd.ExecuteTable();
// }
Related Information
Syntax
Visual Basic
C#
Returns
Exceptions
Remarks
This method is a shortcut for the ULCommand.ExecuteTable method that does not require a ULCommand
object. It is provided to help users porting from earlier versions of UltraLite.NET (it replaces
Sap.UltraLite.Connection.GetTable and Sap.UltraLite.Table.Open methods).
Example
The following code opens the table named MyTable using the index named MyIndex. It assumes an open
ULConnection object called conn.
// C#
ULTable t = conn.ExecuteTable("MyTable", "MyIndex");
// The line above is equivalent to
// ULTable t;
// using(ULCommand cmd = conn.CreateCommand())
// {
// cmd.CommandText = "MyTable";
// cmd.IndexName = "MyIndex";
// cmd.CommandType = CommandType.TableDirect;
Related Information
UL Ext: Retrieves, with the specified command behavior, a database table for direct manipulation.
Syntax
Visual Basic
C#
Parameters
Exceptions
Remarks
Example
The following code opens the table named MyTable using the index named MyIndex. It assumes an open
ULConnection object named conn.
// C#
ULTable t = conn.ExecuteTable(
"MyTable", "MyIndex", CommandBehavior.Default
);
// The line above is equivalent to the following code:
// ULTable t;
// using(ULCommand cmd = conn.CreateCommand())
// {
// cmd.CommandText = "MyTable";
// cmd.IndexName = "MyIndex";
// cmd.CommandType = CommandType.TableDirect;
// t = cmd.ExecuteTable(CommandBehavior.Default);
// }
UL Ext: Returns the time of the most recent download of the specified publication.
Syntax
Visual Basic
C#
Parameters
Returns
The timestamp of the last download. If the SYNC_ALL_DB constant is used for publication, returns the time of
the last download of the entire database.
Exceptions
Remarks
Syntax
Visual Basic
C#
Returns
Exceptions
Remarks
This method is provided here because it is not included in the .NET Compact Framework.
Syntax
Visual Basic
C#
Parameters
Returns
Null if wait period expired or was canceled; otherwise, returns the event name.
Exceptions
Remarks
This method reads an event notification. This call blocks until a notification is received or until the given wait
period expires. To wait indefinitely, pass System.Threading.Timeout.Infinite for the wait_ms parameter. To
cancel a wait, send another notification to the given queue or use the CancelGetNotification method. After
reading a notification, use the ReadNotificationParameter method to retrieve additional parameters.
Related Information
UL Ext: Gets the value of a parameter for an event that was just read by the GetNotification method.
Syntax
Visual Basic
C#
Parameters
Returns
The parameter value if the parameter was found; otherwise, returns null.
Exceptions
Remarks
This method get the value of a parameter for the event notification just read by the ULGetNotification method.
Only the parameters from the most-recently read notification on the given queue are available.
Overload list
public override DataTable GetSchema() [page 188] Returns the list of supported schema
collections.
public override DataTable GetSchema(string) [page 188] Returns information for the specified
metadata collection for this ULConnec
tion object.
public override DataTable GetSchema(string, string[]) [page 189] Returns schema information for the
data source of this ULConnection ob
ject and, if specified, uses the specified
string for the schema name and the
specified string array for the restriction
values.
In this section:
Syntax
Visual Basic
C#
Returns information for the specified metadata collection for this ULConnection object.
Syntax
Visual Basic
C#
Parameters
collection The name of the metadata collection. If no name is provided, the MetaDataCollections value is
used.
Related Information
Returns schema information for the data source of this ULConnection object and, if specified, uses the
specified string for the schema name and the specified string array for the restriction values.
Syntax
Visual Basic
C#
Parameters
collection The name of the metadata collection. If no name is provided, the MetaDataCollections is used.
restrictions A set of restriction values for the requested schema.
Returns
Remarks
This method is used to query the database for various metadata. Each type of metadata is given a collection
name, which must be passed to receive that data. The default collection name is MetaDataCollections.
You can query the .NET data provider to determine the list of supported schema collections by calling the
GetSchema method with no arguments, or with the schema collection name MetaDataCollections. This returns
a DataTable with a list of the supported schema collections (CollectionName), the number of restrictions that
they each support (NumberOfRestrictions), and the number of identifier parts that they use
(NumberOfIdentifierParts).
Collection Metadata
These collection names are also available as read-only properties in the ULMetaDataCollectionNames class.
The results returned can be filtered by specifying an array of restrictions in the call to the GetSchema method.
GetSchema( "Restrictions" )
If the collection requires four restrictions, then the restrictions parameter must be either NULL, or a string with
four values.
To filter on a particular restriction, place the string to filter by in its place in the array and leave any unused
places NULL. For example, the Tables collection has three restrictions: Table, TableType, SyncType.
GetSchema( "Tables", new string[ ] { "my_table", NULL, NULL } ) Returns information about all tables named
my_table.
GetSchema( "Tables", new string[ ] { NULL, "User", NULL } ) Returns information about all user tables.
Related Information
UL Ext: Grants access to an UltraLite database for a user ID with a specified password.
Syntax
Visual Basic
C#
Parameters
Remarks
If an existing user ID is specified, this function updates the password for the user. UltraLite supports a
maximum of 4 users. This method is enabled only if user authentication was enabled when the connection was
opened.
Related Information
Syntax
Visual Basic
C#
Exceptions
InvalidOperationException The connection is already open or the connection string is not specified in the
ULConnection.ConnectionString property.
ULException class A SQL error occurred while attempting to open the database.
Remarks
You should explicitly close or dispose of the connection when you are done with it.
Related Information
Syntax
Visual Basic
C#
Parameters
Exceptions
Remarks
This method registers a queue to receive notifications of an event. The default connection queue is implied and
created if a queue name is not supplied. Certain system events allow specification of an object name to which
the event applies. For example, the TableModified event can specify the table name. Unlike the
SendNotification method, only the specific queue registered receives notifications of the event; other queues
with the same name on different connections do not (unless they are also explicit registered). This method
throws an error if the queue or event does not exist.
Related Information
Syntax
Visual Basic
C#
Exceptions
Related Information
UL Ext: Revokes access to an UltraLite database from the specified user ID.
Syntax
Visual Basic
C#
Parameters
Related Information
UL Ext: Rolls back outstanding changes to the database from a partial download.
Syntax
Visual Basic
C#
Exceptions
Related Information
Syntax
Visual Basic
C#
Parameters
Returns
Exceptions
Remarks
This method send a notification to all queues matching the given name (including any such queue on the
current connection). This call does not block. Use the special queue name "*" to send to all queues.
Syntax
Visual Basic
C#
Parameters
listener The ULSyncProgressListener object that implements the SyncProgressed method, which is called
for synchronization messages on this connection.
Exceptions
Remarks
When the SYNCHRONIZE profileName SQL statement is executed, its progress messages are routed to a
syncListener object, if not null (Nothing in Visual Basic).
To remove the listener, pass a null reference in a call to the SetSyncListener method.
UL Ext: Marks all subsequent deletes made by this connection for synchronization.
Syntax
Visual Basic
C#
Exceptions
Remarks
When this method is called, all delete operations are again synchronized, causing the rows deleted from the
UltraLite database to be removed from the consolidated database as well.
Related Information
Syntax
Visual Basic
C#
Exceptions
Remarks
This method is useful for deleting old information about an UltraLite database to save space, while not deleting
this information about the consolidated database.
Related Information
Overload list
public void Synchronize() [page 200] UL Ext: Synchronizes the database us
ing the current ULConnection.Syn
cParms object.
In this section:
Syntax
Visual Basic
C#
Exceptions
Related Information
UL Ext: Synchronizes the database using the current ULConnection.SyncParms object with progress events
posted to the specified listener.
Syntax
Visual Basic
C#
Parameters
Exceptions
Remarks
Related Information
Syntax
Visual Basic
C#
Parameters
Returns
Remarks
This method triggers an event (and send notification to all registered queues).
Related Information
Overload list
In this section:
Syntax
Visual Basic
C#
Parameters
Exceptions
Example
// C#
conn.ValidateDatabase( Sap.Data.UltraLite.ULVF_INDEX )
Related Information
Syntax
Visual Basic
C#
Parameters
Exceptions
Example
// C#
conn.ValidateDatabase( Sap.Data.UltraLite.ULVF_INDEX, null )
Related Information
Syntax
Visual Basic
C#
Remarks
The parameters used to open this connection should be a semicolon-separated list of keyword=value pairs.
The default is an empty string (an invalid connection string).
UL Ext: The parameters used by UltraLite.NET are specific to UltraLite databases and therefore the connection
string is not compatible with SQL Anywhere connection strings.
Parameter values can be quoted with either single quote characters or double quote characters provided that
the quoted contents do not contain quote characters of the same type. Values must be quoted if they contain
semicolons, begin with a quote, or require leading or trailing whitespace.
If you are not quoting parameter values, make sure that they do not contain semicolons, and that they begin
with either a single quote or a double quote character. Leading and trailing spaces in values are ignored.
By default, connections are opened with UID=DBA and PWD=sql. To make the database more secure, change
the user DBA's password or create new users (using the GrantConnectTo method) and remove the DBA user
(using RevokeConnectFrom).
Example
The following code creates and opens a connection to the existing database \UltraLite\MyDatabase.udb on
a Windows Mobile device.
// C#
Related Information
Syntax
Visual Basic
C#
Remarks
Syntax
Visual Basic
C#
On Windows Mobile devices, the ULConnection object looks in the connection string in the following order: dbn,
ce_file.
On desktop machines, the ULConnection object looks in the connection string in the following order: dbn,
nt_file.
UL Ext: Specifies the Database ID value to be used for global autoincrement columns.
Syntax
Visual Basic
C#
Remarks
Related Information
Syntax
Visual Basic
C#
Remarks
UL Ext: Returns the percentage of available global autoincrement values that have been used.
Syntax
Visual Basic
C#
Remarks
The percentage of available global autoincrement values that have been used. It is an integer in the range
[0-100], inclusive.
If the percentage approaches 100, your application should set a new value for the global database ID using the
ULConnection.DatabaseID value.
Syntax
Visual Basic
C#
Remarks
The most recent identity value used. This property is equivalent to the SQL Anywhere statement:
SELECT @identity
The LastIdentity property is particularly useful in the context of global autoincrement columns.
Since this property only allows you to determine the most recently assigned default value, you should retrieve
this value soon after executing the insert statement to avoid spurious results.
Occasionally, a single insert statement may include more than one column of type global autoincrement. In this
case, the LastIdentity property is one of the generated default values, but there is no reliable means to
determine from which column the value is. For this reason, you should design your database and write your
insert statements to avoid this situation.
UL Ext: Provides access to the schema of the current database associated with this connection.
Syntax
Visual Basic
Remarks
A reference to the ULDatabaseSchema object representing the schema of the database on which this
connection opens.
Related Information
Syntax
Visual Basic
C#
Remarks
Syntax
Visual Basic
C#
Remarks
Related Information
Syntax
Visual Basic
C#
Remarks
A reference to the ULSyncParms object representing the parameters used for synchronization by this
connection. Modifications to the parameters affect the next synchronization made over this connection.
UL Ext: Returns the results of the last synchronization for this connection.
Syntax
Visual Basic
C#
Remarks
A reference to the ULSyncResult object representing the results of the last synchronization for this connection.
Related Information
Syntax
Visual Basic
C#
Example
// C#
private void MyInfoMessageHandler(
object obj, ULInfoMessageEventArgs args
)
{
System.Console.WriteLine(
"InfoMessageHandler: " + args.NativeError + ", "
+ args.Message
);
}
The following code adds the MyInfoMessageHandler method to the connection named conn.
// C#
conn.InfoMessage +=
new ULInfoMessageEventHandler(MyInfoMessageHandler);
Related Information
Syntax
Visual Basic
C#
Remarks
To process state change messages, you must create a System.Data.StateChangeEventHandler delegate and
attach it to this event.
Example
// C#
private void MyStateHandler(
object obj, StateChangeEventArgs args
)
{
System.Console.WriteLine(
"StateHandler: " + args.OriginalState + " to "
+ args.CurrentState
);
}
The following code adds the MyStateHandler to the connection named conn.
// C#
conn.StateChange += new StateChangeEventHandler(MyStateHandler);
Syntax
Visual Basic
C#
Members
Constructors
Methods
public override string ToString() [page 219] Returns the string representation of
this instance.
Properties
public string CacheSize [page 221] Specifies the size of the cache.
public string ConnectionName [page 222] Specifies a name for the connection.
public string DatabaseOnDesktop [page 223] Specifies the path and file name of the
UltraLite database on Windows desktop
platforms.
public string DatabaseOnDevice [page 223] Specifies the path and file name of the
UltraLite database on Windows Mobile.
public string EncryptionKey [page 224] Specifies a key for encrypting the data
base.
public string Password [page 224] Specifies the password for the authenti
cated user.
public string UserID [page 225] Specifies an authenticated user for the
database.
Remarks
The frequently-used connection parameters are individual properties on the ULConnectionParms object.
A ULConnectionParms 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
ULConnectionParms object, you create a connection string using the ULConnectionParms.ToString method.
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.
Each instance contains platformspecific 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.
// C#
ULConnectionParms dbName = new ULConnectionParms();
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.
Depending on your application's needs and how the database was created, you might need to supply a non-
default ULConnectionParms.UserID value, a non-default ULConnectionParms.Password value, a database
ULConnectionParms.EncryptionKey value, and the ULConnectionParms.CacheSize value. If your application is
using multiple connections, you should provide a unique ULConnectionParms.ConnectionName value for each
connection.
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.
In this section:
Related Information
Syntax
Visual Basic
C#
public ULConnectionParms ()
Syntax
Visual Basic
C#
Returns
Syntax
Visual Basic
C#
Remarks
A semicolon-separated list of keyword=value additional parameters. Values of the keyword=value list must
conform to the rules for ULConnection.ConnectionString. The default is a null reference (Nothing in Visual
Basic).
The values for the page size and reserve size parameters are specified in units of bytes. Use the suffix k or K to
indicate units of kilobytes and the suffix m or M to indicate megabytes.
Keyword Description
start Specifies the location and then starts the UltraLite engine.
Only supply a StartLine (START) connection parameter if
you are connecting to an engine that is not currently run
ning. The location is only required when the UltraLite engine
is not in the system path.
Related Information
Syntax
Visual Basic
C#
A string specifying the cache size. The default is a null reference (Nothing in Visual Basic) meaning the default
of 16 pages is used.
The values for the cache size are specified in units of bytes. Use the suffix k or K to indicate units of kilobytes
and the suffix of m or M to indicate megabytes.
For example, the following sets the cache size to 128 KB.
connParms.CacheSize = "128k"
The default cache size is 16 pages. Using the default page size of 4 KB, the default cache size is therefore 64
KB. The minimum cache size is platform dependent.
The default cache size is conservative. If your testing shows the need for better performance, you should
increase the cache size.
Increasing the cache size beyond the size of the database itself provides no performance improvement and
large cache sizes might interfere with the number of other applications you can use.
If the cache size is unspecified or improperly specified, the default size is used.
Syntax
Visual Basic
C#
Remarks
This is only needed if you create more than one connection to the database.
A string specifying the name of the connection. The default is a null reference (Nothing in Visual Basic).
Specifies the path and file name of the UltraLite database on Windows desktop platforms.
Syntax
Visual Basic
C#
Remarks
A string specifying the absolute or relative path to the database. If the value is a null reference (Nothing in
Visual Basic), the database ulstore.udb is used. In C#, you must escape any backslash characters in paths or
use @-quoted string literals. The default is a null reference (Nothing in Visual Basic).
Specifies the path and file name of the UltraLite database on Windows Mobile.
Syntax
Visual Basic
C#
Remarks
A string specifying the full path to the database. If the value is a null reference (Nothing in Visual Basic), the
database \UltraLiteDB\ulstore.udb is used. In C#, you must escape any backslash characters in paths or use
@-quoted string literals. The default is a null reference (Nothing in Visual Basic).
Syntax
Visual Basic
C#
Remarks
A string specifying the encryption key. The default is a null reference (Nothing in Visual Basic) meaning no
encryption.
All connections must use the same key as was specified when the database was created. Lost or forgotten keys
result in completely inaccessible databases.
As with all passwords, it is best to choose a key value that cannot be easily guessed. The key can be of arbitrary
length, but generally the longer the key, the better, because a shorter key is easier to guess than a longer one.
Using a combination of numbers, letters, and special characters decreases the chances of someone guessing
the key.
Related Information
Syntax
C#
A string specifying a database user ID. The default is a null reference (Nothing in Microsoft Visual Basic).
Related Information
Syntax
Visual Basic
C#
Remarks
A string specifying a database user ID. The default value is a null reference (Nothing in Visual Basic).
Databases are initially created with a single authenticated user named DBA.
If both the user ID and password are not supplied, the user DBA with password sql are used. To make the
database more secure, change the user DBA's password or create new users (with the
ULConnection.GrantConnectTo method) and remove the DBA user (with the
ULConnection.RevokeConnectFrom method).
Related Information
Syntax
Visual Basic
C#
Members
Constructors
Methods
public override bool ContainsKey(string) [page 231] Determines whether the ULConnection
StringBuilder object contains a specific
keyword.
public static string GetShortName(string) [page 232] Retrieves the short version of the sup
plied keyword.
public override bool Remove(string) [page 233] Removes the entry with the specified
key from the ULConnectionString
Builder object.
public override bool TryGetValue(string, out Object) [page Retrieves a value corresponding to the
233] supplied key from this ULConnection
StringBuilder object.
Properties
public string CacheSize [page 234] UL Ext: Specifies the size of the cache.
public string ConnectionName [page 235] Specifies a name for the connection.
public string DatabaseKey [page 236] Specifies a key for encrypting the data
base.
public string DatabaseName [page 236] Specifies a name for the database or
the name of a loaded database to which
a connection needs to be made.
public string DatabaseOnDesktop [page 237] UL Ext: Specifies the path and file name
of the UltraLite database on Windows
desktop platforms.
public string DatabaseOnDevice [page 238] UL Ext: Specifies the path and file name
of the UltraLite database on Windows
Mobile.
public string OrderedTableScans [page 238] Specifies whether SQL queries without
ORDER BY clauses should perform or
dered table scans by default.
public string Password [page 239] Specifies the password for the authenti
cated user.
public string ReserveSize [page 239] UL Ext: Specifies the reserve file system
space for storage of UltraLite persistent
data.
public string StartLine [page 240] Specifies the location and then starts
the UltraLite engine.
public override object this[string keyword] [page 241] Specifies the value of the specified con
nection keyword.
public string UserID [page 242] Specifies an authenticated user for the
database.
Remarks
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
Each instance contains platformspecific 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.
// 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.
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.
In this section:
Related Information
Overload list
In this section:
Syntax
Visual Basic
C#
public ULConnectionStringBuilder ()
Syntax
Visual Basic
C#
Parameters
Syntax
Visual Basic
C#
Parameters
Returns
True if this connection string builder contains a value for the specified keyword, otherwise returns false.
Compares the connection information in this ULConnectionStringBuilder object with the connection
information in the supplied DbConnectionStringBuilder object.
Syntax
Visual Basic
C#
Parameters
Returns
True if this object is equivalent to the specified DbConnectionStringBuilder object; otherwise, returns false.
Syntax
Visual Basic
C#
Returns
The short version of the supplied keyword if keyword is recognized, null otherwise.
Removes the entry with the specified key from the ULConnectionStringBuilder object.
Syntax
Visual Basic
C#
Parameters
Returns
True if the key existed within the connection string and was removed; false if the key did not exist.
Retrieves a value corresponding to the supplied key from this ULConnectionStringBuilder object.
Syntax
Visual Basic
C#
Parameters
Returns
True if keyword was found within the connection string, false otherwise.
Remarks
The TryGetValue method lets developers safely retrieve a value from a ULConnectionStringBuilder without
needing to first call the ContainsKey method. Because the TryGetValue method does not raise an exception
when you call it, passing in a nonexistent key, you do not have to look for a key before retrieving its value.
Calling TryGetValue with a nonexistent key places the null value (Nothing in Visual Basic) in the value
parameter.
Syntax
Visual Basic
C#
A string specifying the cache size. The default is a null reference (Nothing in Visual Basic) meaning the default
of 16 pages is used.
The values for the cache size are specified in units of bytes. Use the suffix k or K to indicate units of kilobytes
and the suffix of m or M to indicate megabytes.
For example, the following sets the cache size to 128 KB.
connParms.CacheSize = "128k"
The default cache size is 16 pages. Using the default page size of 4 KB, the default cache size is therefore 64
KB. The minimum cache size is platform dependent.
The default cache size is conservative. If your testing shows the need for better performance, you should
increase the cache size.
Increasing the cache size beyond the size of the database itself provides no performance improvement and
large cache sizes might interfere with the number of other applications you can use.
If the cache size is unspecified or improperly specified, the default size is used.
Syntax
Visual Basic
C#
Remarks
This is only needed if you create more than one connection to the database.
A string specifying the name of the connection. The default is a null reference (Nothing in Visual Basic).
Syntax
Visual Basic
C#
Remarks
A string specifying the encryption key. The default is a null reference (Nothing in Visual Basic) meaning no
encryption.
All connections must use the same key as was specified when the database was created. Lost or forgotten keys
result in completely inaccessible databases.
As with all passwords, it is best to choose a key value that cannot be easily guessed. The key can be of arbitrary
length, but generally the longer the key, the better, because a shorter key is easier to guess than a longer one.
Using a combination of numbers, letters, and special characters decreases the chances of someone guessing
the key.
Related Information
Specifies a name for the database or the name of a loaded database to which a connection needs to be made.
Syntax
Visual Basic
C#
A string specifying the name of the database. The default is a null reference (Nothing in Visual Basic).
When a database is started, it is assigned a database name, either explicitly with the dbn parameter, or by
UltraLite using the base of the file name with the extension and path removed.
When opening connections, UltraLite first searches for a running database with a matching dbn parameter. If
one is not found, UltraLite starts a new database using the appropriate database file name parameter (the
DatabaseOnDevice or DatabaseOnDesktop properties).
This parameter is required if the application (or UltraLite engine) needs to access two different databases that
have the same base file name.
Related Information
UL Ext: Specifies the path and file name of the UltraLite database on Windows desktop platforms.
Syntax
Visual Basic
C#
Remarks
A string specifying the absolute or relative path to the database. If the value is a null reference (Nothing in
Visual Basic), the database ulstore.udb is used. In C#, you must escape any backslash characters in paths or
use @-quoted string literals. The default is a null reference (Nothing in Visual Basic).
UL Ext: Specifies the path and file name of the UltraLite database on Windows Mobile.
Syntax
Visual Basic
C#
Remarks
A string specifying the full path to the database. If the value is a null reference (Nothing in Visual Basic), the
database \UltraLiteDB\ulstore.udb is used. In C#, you must escape any backslash characters in paths or use
@-quoted string literals. The default is a null reference (Nothing in Visual Basic).
Specifies whether SQL queries without ORDER BY clauses should perform ordered table scans by default.
Syntax
Visual Basic
C#
Remarks
A boolean string specifying whether to use ordered table scans or not. For example, true/false, yes/no, 1/0,
and so on. The default value is a null reference (Nothing in Visual Basic).
When using dynamic SQL in UltraLite, if order is not important for executing a query, UltraLite accesses the
rows directly from the database pages rather than using the primary key index. This improves performance of
fetching rows. To use this optimization, the query must be read only and must scan all the rows.
When rows are expected in a specific order, an ORDER BY statement should be included as part of the SQL
query. However, it's possible that some applications have come to rely on the behavior that defaults to
When the OrderedTableScans value is set to 1 (true, yes, on) and the user does not specify an ORDER BY
clause or if a query would not benefit from an index, UltraLite defaults to using the primary key.
Syntax
Visual Basic
C#
Remarks
A string specifying a database user ID. The default is a null reference (Nothing in Visual Basic).
When a database is created, the password for the DBA user ID is set to sql.
Related Information
Syntax
Visual Basic
C#
A string specifying the reserve size. The default is a null reference (Nothing in Visual Basic).
The values for the reserve size parameter is specified in units of bytes. Use the suffix k or K to indicate units of
kilobytes and the suffix m or M to indicate megabytes.
The reserve_size parameter allows you to pre-allocate the file system space required for your UltraLite
database without inserting any data. Reserving file system space can improve performance slightly and also
prevent out of memory failures. By default, the persistent storage file only grows when required as the
application updates the database.
The reserve_size reserves file system space, which includes the metadata in the persistent store file, and not
just the raw data. The metadata overhead and data compression must be considered when deriving the
required file system space from the amount of database data.
The reserve_size parameter reserves space by growing the persistent store file to the given reserve size on
startup, regardless of whether the file previously existed. The file is never truncated.
The following parameter string ensures that the persistent store file is at least 2 MB upon startup.
connParms.ReserveSize = "2m"
Syntax
Visual Basic
C#
Remarks
A string specifying the location of the UltraLite engine executable. The default value is a null reference (Nothing
in Visual Basic).
Only supply a StartLine (START) connection parameter if you are connecting to an engine that is not currently
running.
Syntax
Visual Basic
C#
Remarks
Connection keywords and the corresponding properties of the ULConnectionStringBuilder class are described
in the table below:
cache_size ULConnectionStringBuilder.CacheSize
ce_file ULConnectionStringBuilder.DatabaseOnDevice
con ULConnectionStringBuilder.ConnectionName
dbkey ULConnectionStringBuilder.DatabaseKey
dbn ULConnectionStringBuilder.DatabaseName
nt_file ULConnectionStringBuilder.DatabaseOnDesktop
pwd ULConnectionStringBuilder.Password
reserve_size ULConnectionStringBuilder.ReserveSize
start ULConnectionStringBuilder.StartLine
uid ULConnectionStringBuilder.UserID
Related Information
Syntax
Visual Basic
C#
Remarks
A string specifying a database user ID. The default value is a null reference (Nothing in Visual Basic).
Databases are initially created with a single authenticated user named DBA.
If both the user ID and password are not supplied, the user DBA with password sql are used. To make the
database more secure, change the user DBA's password or create new users (with the
ULConnection.GrantConnectTo method) and remove the DBA user (with the
ULConnection.RevokeConnectFrom method).
Related Information
Syntax
Visual Basic
C#
Members
Constructors
Methods
public override string ToString() [page 247] Returns the string representation of
this instance.
Properties
public bool CaseSensitive [page 247] Specifies whether the new database
should be case sensitive when compar
ing string values.
public int ChecksumLevel [page 248] Specifies the level of database page
checksums enabled for the new data
base.
public string DateFormat [page 248] Specifies the date format used for
string conversions by the new data
base.
public ULDateOrder DateOrder [page 249] Specifies the date order used for string
conversions by the new database.
public bool FIPS [page 249] Specifies whether the new database
should be using AES_FIPS encryption
or AES encryption.
public int MaxHashSize [page 250] Specifies the default maximum number
of bytes to use for index hashing in the
new database.
public int NearestCentury [page 250] Specifies the nearest century used for
string conversions by the new data
base.
public bool Obfuscate [page 251] Specifies whether the new database
should use obfuscation to encrypt the
database.
public int PageSize [page 251] Specifies the page size, in bytes or kilo
bytes, of the new database.
public int Scale [page 253] Specifies the minimum number of dig
its after the decimal point when an
arithmetic result is truncated to the
maximum precision during string con
versions by the new database.
public string TimeFormat [page 253] Specifies the time format used for
string conversions by the new data
base.
public string TimestampFormat [page 254] Specifies the timestamp format used
for string conversions by the new data
base.
public int TimestampIncrement [page 254] Specifies the minimum difference be
tween two unique timestamps, in mi
croseconds (1,000,000th of a second).
public bool UTF8Encoding [page 255] Specifies whether the new database
should be using the UTF8 character set
or the character set associated with the
collation.
Remarks
A ULCreateParms object is used to specify the parameters for creating a database with the
ULDatabaseManager.CreateDatabase method.
Leading and trailing spaces are ignored in all string values. Values must not contain leading or trailing spaces,
or a semicolon, or begin with either a single quote or a double quote.
Once you have supplied all the creation parameters by setting the appropriate properties on a ULCreateParms
object, you create a creation parameters string using the ULCreateParms.ToString method. The resulting string
can then be used as the createParms parameter of the ULDatabaseManager.CreateDatabase method.
The following code creates the database \UltraLite\MyDatabase.udb on a Windows Mobile device. The
database is created case sensitive and with the UTF8 character set.
// C#
ULCreateParms createParms = new ULCreateParms();
createParms.CaseSensitive = true;
createParms.UTF8Encoding = true;
ULConnectionParms openParms = new ULConnectionParms();
openParms.DatabaseOnDevice = ".udb";
ULConnection.DatabaseManager.CreateDatabase(
openParms.ToString(),
createParms.ToString()
);
ULConnection conn = new ULConnection( openParms.ToString() );
conn.Open();
In this section:
Related Information
Syntax
Visual Basic
C#
public ULCreateParms ()
Syntax
Visual Basic
C#
Returns
Specifies whether the new database should be case sensitive when comparing string values.
Syntax
Visual Basic
C#
Remarks
True if the database should be case sensitive; false if the database should be case insensitive. The default is
false.
This method only affects how string data is compared and sorted. Database identifiers such as table names,
column names, index names, and connection user IDs are always case insensitive. Connection passwords and
database encryption keys are always case sensitive.
Specifies the level of database page checksums enabled for the new database. This topic has been updated
for 17.0 PL 41 Build 5745.
Syntax
Visual Basic
C#
Remarks
An integer specifying the checksum level. Valid values are 0, 1, and 2. The default is 2.
Specifies the date format used for string conversions by the new database.
Syntax
Visual Basic
C#
Remarks
A string specifying the date format. If the value is a null reference (Nothing in Visual Basic), the database uses
"YYYY-MM-DD". In C#, you must escape any backslash characters in paths or use @-quoted string literals. The
default is a null reference (Nothing in Visual Basic).
Specifies the date order used for string conversions by the new database.
Syntax
Visual Basic
C#
Remarks
A ULDateOrder value identifying the date order for string conversions. The default is YMD.
Related Information
Specifies whether the new database should be using AES_FIPS encryption or AES encryption.
Syntax
Visual Basic
C#
Remarks
True if the database should be encrypted using AES_FIPS, false if the database should be encrypted with AES.
The default is false.
Related Information
Specifies the default maximum number of bytes to use for index hashing in the new database.
Syntax
Visual Basic
C#
Remarks
An integer specifying the maximum hash size. The value must be in the range [0,32]. The default is 8.
Specifies the nearest century used for string conversions by the new database.
Syntax
Visual Basic
C#
An integer specifying the nearest century. The value must be in the range [0,100]. The default is 50.
Specifies whether the new database should use obfuscation to encrypt the database.
Syntax
Visual Basic
C#
Remarks
True if the database should be encrypted using obfuscation, false if the database should not be obfuscated.
The default is false.
This option is ignored if FIPS encryption is turned on with the ULCreateParms.FIPS property. The encryption
key is ignored if obfuscation is turned on and a value is supplied for the EncryptionKey connection parameter
when the new database is created.
Related Information
Syntax
Visual Basic
Remarks
An integer specifying the page size in bytes. Valid values are 1024 (1K), 2048 (2K), 4096 (4K), 8192 (8K), 16384
(16K). The default is 4096.
Specifies the floatingpoint precision used for string conversions by the new database.
Syntax
Visual Basic
C#
Remarks
An integer specifying the precision. The value must be in the range [1,127]. The default is 30.
Related Information
Specifies the minimum number of digits after the decimal point when an arithmetic result is truncated to the
maximum precision during string conversions by the new database.
Syntax
Visual Basic
C#
Remarks
An integer specifying the scale. The value must be in the range [0,127]. The default is 6.
The Scale value must be less than or equal to the Precision value; otherwise, an error occurs when creating the
database.
Specifies the time format used for string conversions by the new database.
Syntax
Visual Basic
C#
Remarks
A string specifying the time format. If the value is a null reference (Nothing in Visual Basic), the database uses
"HH:NN:SS.SSS". In C#, you must escape any backslash characters in paths or use @-quoted string literals.
The default is a null reference (Nothing in Visual Basic).
Specifies the timestamp format used for string conversions by the new database.
Syntax
Visual Basic
C#
Remarks
A string specifying the timestamp format. If the value is a null reference (Nothing in Visual Basic), the database
uses "YYYY-MM-DD HH:NN:SS.SSS". In C#, you must escape any backslash characters in paths or use @-
quoted string literals. The default is a null reference (Nothing in Visual Basic).
Specifies the minimum difference between two unique timestamps, in microseconds (1,000,000th of a
second).
Syntax
Visual Basic
C#
Remarks
An integer specifying the timestamp increment. The value must be in the range [1,60000000]. The default is 1.
Specifies whether the new database should be using the UTF8 character set or the character set associated
with the collation.
Syntax
Visual Basic
C#
Remarks
True if the database should use the UTF8 character set, false if the database should use the character set
associated with the collation. The default is false.
Choose to use the UTF8 character set to store characters that are not in the character set associated with the
collation. For example, you create a database with the 1252LATIN1 collation because you want US sorting but
specify UTF8Encoding true because you want to store international addresses as they are spelled locally.
Syntax
Visual Basic
C#
Members
Methods
public unsafe short GetColumnID(string) [page 258] Returns the column ID of the named
column.
public string GetColumnName(int) [page 259] Returns the name of the column identi
fied by the specified column ID.
public unsafe int GetColumnPrecision(int) [page 260] Returns the precision of the column
identified by the specified column ID if
the column is a numeric column (the
NUMERIC SQL type).
public unsafe int GetColumnScale(int) [page 261] Returns the scale of the column identi
fied by the specified column ID if the
column is a numeric column (the NU
MERIC SQL type).
public unsafe int GetColumnSize(int) [page 262] Returns the size of the column identi
fied by the specified column ID if the
column is a sized column (the BINARY
or CHAR SQL types).
public string GetColumnSQLName(int) [page 263] Returns the name of the column identi
fied by the specified column ID.
public unsafe ULDbType GetColumnULDbType(int) [page 264] Returns the UltraLite.NET data type of
the column identified by the specified
column ID.
Properties
public short ColumnCount [page 266] Returns the number of columns in the
cursor.
public bool IsOpen [page 266] Checks whether the cursor schema is
currently open.
public abstract string Name [page 267] Returns the name of the cursor.
Remarks
This class is an abstract base class of the ULTableSchema class and the ULResultSetSchema class.
Note
For users porting from the Sap.UltraLite namespace, Column IDs are 0-based, not 1-based as they are in
the Sap.UltraLite namespace.
Related Information
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
Parameters
Returns
Exceptions
In result sets, not all columns have names and not all column names are unique. If you are not using aliases, the
name of a non-computed column is prefixed with the name of the table the column is from. For example,
MyTable.ID is the name of the only column in the result set for the query "SELECT ID FROM MyTable".
Column IDs and counts might change during a schema upgrade. To correctly identify a column, access it by
name or refresh the cached IDs and counts after a schema upgrade.
Related Information
Returns the name of the column identified by the specified column ID.
Syntax
Visual Basic
C#
Parameters
columnID The ID of the column. The value must be in the range [0,ColumnCount-1].
Returns
The name of the column or a null reference (Nothing in Visual Basic) if the column has no name. If the column
is aliased in the SQL query, the alias is returned.
Remarks
In result sets, not all columns have names and not all column names are unique. If you are not using aliases, the
name of a non-computed column is prefixed with the name of the table the column is from. For example,
MyTable.ID is the name of the only column in the result set for the query "SELECT ID FROM MyTable".
Column IDs and count may change during a schema upgrade. To correctly identify a column, access it by name
or refresh the cached IDs and counts after a schema upgrade.
Related Information
Returns the precision of the column identified by the specified column ID if the column is a numeric column
(the NUMERIC SQL type).
Syntax
Visual Basic
C#
Parameters
columnID The ID of the column. The value must be in the range [0,ColumnCount-1].
Exceptions
Related Information
Returns the scale of the column identified by the specified column ID if the column is a numeric column (the
NUMERIC SQL type).
Syntax
Visual Basic
C#
Parameters
columnID The ID of the column. The value must be in the range [0,ColumnCount-1].
Returns
Related Information
Returns the size of the column identified by the specified column ID if the column is a sized column (the
BINARY or CHAR SQL types).
Syntax
Visual Basic
C#
Parameters
columnID The ID of the column. The value must be in the range [0,ColumnCount-1].
Returns
Exceptions
Returns the name of the column identified by the specified column ID.
Syntax
Visual Basic
C#
Parameters
columnID The ID of the column. The value must be in the range [0,ColumnCount-1].
Returns
The name of the column or a null reference (Nothing in Visual Basic) if the column has no name. If the column
is aliased in the SQL query, the alias is returned.
Exceptions
Remarks
In result sets, not all columns have names and not all column names are unique. If you are using aliases, the
name of the column is the alias.
The GetColumnSQLName method differs from the GetColumnName method because the
GetColumnSQLName method always returns just the name of the column (without the table name as a prefix)
Column IDs and count may change during a schema upgrade. To correctly identify a column, access it by name
or refresh the cached IDs and counts after a schema upgrade.
Related Information
Returns the UltraLite.NET data type of the column identified by the specified column ID.
Syntax
Visual Basic
C#
Parameters
columnID The ID of the column. The value must be in the range [0,ColumnCount-1].
Returns
Exceptions
Returns a System.Data.DataTable that describes the column schema of the ULDataReader object.
Syntax
Visual Basic
C#
Returns
Related Information
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
Remarks
Column IDs and count might change during a schema upgrade. To correctly identify a column, access it by
name or refresh the cached IDs and counts after a schema upgrade.
Syntax
Visual Basic
C#
Remarks
True if the cursor schema is currently open; false if the cursor schema is closed.
Syntax
Visual Basic
C#
Remarks
Represents a set of commands and a database connection used to fill a System.Data.DataSet and to update a
database.
Syntax
Visual Basic
C#
Members
Methods
protected override void Dispose(bool) [page 273] Releases the unmanaged resources
used by the ULDataAdapter object and
optionally releases the managed re
sources.
public new ULParameter[] GetFillParameters() [page 277] Returns the parameters set by the user
when executing a SELECT statement.
Properties
public new ULCommand DeleteCommand [page 278] Specifies a ULCommand object that is
executed against the database when
the DbDataAdapter.Update method is
called to delete rows in the database
that correspond to deleted rows in the
System.Data.DataSet.
public new ULCommand InsertCommand [page 278] Specifies a ULCommand object that is
executed against the database when
the DbDataAdapter.Update method is
called to insert rows in the database
that correspond to inserted rows in the
System.Data.DataSet.
public new ULCommand SelectCommand [page 279] Specifies a ULCommand that is used
during the System.Data.Com
mon.DbDataAdapter.Fill(Sys
tem.Data.DataSet) or Sys
tem.Data.Common.DbDataAdapter.Fill
Schema(System.Data.DataSet,Sys
tem.Data.SchemaType) method calls to
obtain a result set from the database
for copying into a System.Data.Data
Set.
public new DataTableMappingCollec TableMappings [page 280] Returns a collection that provides the
tion master mapping between a source ta
ble and a System.Data.DataTable
public new ULCommand UpdateCommand [page 281] Specifies a ULCommand object that is
executed against the database when
the System.Data.Common.DbDataA
dapter.Update method is called to up
date rows in the database that corre
spond to updated rows in the Sys
tem.Data.DataSet.
Events
public ULRowUpdatedEventHandler RowUpdated [page 281] Occurs during an update after a com
mand is executed against the data
source.
public ULRowUpdatingEventHandler RowUpdating [page 282] Occurs during an update before a com
mand is executed against the data
source.
Remarks
The System.Data.DataSet provides a way to work with data offline; that is, away from your UltraLite database.
The ULDataAdapter class provides methods to associate a System.Data.DataSet with a set of SQL statements.
Since UltraLite is a local database and MobiLink has conflict resolution, the use of the ULDataAdapter is
limited. For most purposes, the ULDataReader or ULTable classes provide more efficient access to data.
In this section:
Related Information
Overload list
In this section:
Syntax
Visual Basic
C#
public ULDataAdapter ()
Related Information
Syntax
Visual Basic
C#
Parameters
Initializes a ULDataAdapter object with the specified SELECT statement and connection.
Syntax
Visual Basic
C#
public ULDataAdapter (
string selectCommandText,
ULConnection selectConnection
)
Parameters
Related Information
Syntax
Visual Basic
C#
public ULDataAdapter (
string selectCommandText,
string selectConnectionString
)
Parameters
Related Information
Syntax
Visual Basic
C#
disposing When true, disposes of both managed and unmanaged resources. When false, disposes of only
the unmanaged resources.
Overload list
In this section:
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
Overload list
In this section:
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
Returns the parameters set by the user when executing a SELECT statement.
Syntax
Visual Basic
C#
Returns
An array of ULParameter objects that contains the parameters set by the user.
Remarks
Related Information
Syntax
Visual Basic
C#
Specifies a ULCommand object that is executed against the database when the DbDataAdapter.Update
method is called to delete rows in the database that correspond to deleted rows in the System.Data.DataSet.
Syntax
Visual Basic
C#
Remarks
A ULCommand object that is executed to delete rows in the database that correspond to deleted rows in the
System.Data.DataSet.
When the DeleteCommand property is assigned to an existing ULCommand object, the ULCommand object is
not cloned. The DeleteCommand property maintains a reference to the existing ULCommand object.
Related Information
Specifies a ULCommand object that is executed against the database when the DbDataAdapter.Update
method is called to insert rows in the database that correspond to inserted rows in the System.Data.DataSet.
Syntax
Visual Basic
Remarks
A ULCommand object that is executed to insert rows in the database that correspond to inserted rows in the
System.Data.DataSet.
When the InsertCommand property is assigned to an existing ULCommand object, the ULCommand object is
not cloned. The InsertCommand property maintains a reference to the existing ULCommand object.
Related Information
Syntax
Visual Basic
C#
Remarks
When SelectCommand property is assigned to an existing ULCommand object, the ULCommand object is not
cloned. The SelectCommand property maintains a reference to the existing ULCommand object.
Related Information
Returns a collection that provides the master mapping between a source table and a System.Data.DataTable
Syntax
Visual Basic
C#
Remarks
Specifies a ULCommand object that is executed against the database when the
System.Data.Common.DbDataAdapter.Update method is called to update rows in the database that
correspond to updated rows in the System.Data.DataSet.
Syntax
Visual Basic
C#
Remarks
A ULCommand object that is executed to update rows in the database that correspond to updated rows in the
System.Data.DataSet.
When UpdateCommand is assigned to an existing ULCommand object, the ULCommand object is not cloned.
The UpdateCommand property maintains a reference to the existing ULCommand object.
If execution of this command returns rows, these rows may be merged with the System.Data.DataSet
depending on how you set the ULCommand.UpdatedRowSource property of the ULCommand object.
Related Information
Occurs during an update after a command is executed against the data source.
Syntax
Visual Basic
Remarks
To process row updated events, you must create a ULRowUpdatedEventHandler delegate and attach it to this
event.
Related Information
Occurs during an update before a command is executed against the data source.
Syntax
Visual Basic
C#
Remarks
To process row updating events, you must create a ULRowUpdatingEventHandler delegate and attach it to this
event.
Related Information
Syntax
Visual Basic
C#
Members
public static void CreateDatabase(string, string) [page Creates a new UltraLite database.
284]
public static void DropDatabase(string) [page 286] Deletes the specified database.
public static void SetActiveSyncListener(string, ULActi Specifies the listener object used to
veSyncListener) [page 287] process ActiveSync calls from the Mo
biLink provider for ActiveSync.
public static void SetServerSyncListener(string, string, Specifies the listener object used to
ULServerSyncListener) [page 288] process the specified server synchroni
zation message.
public static void SignalSyncIsComplete() [page 290] Signals the MobiLink provider for Ac
tiveSync that an application has com
pleted synchronization.
public static void ValidateDatabase(string, ULDBValid) Performs low level and index validation
[page 290] on a database.
Properties
Remarks
To use the UltraLite Engine runtime of UltraLite.NET, set the ULDatabaseManager.RuntimeType property to the
appropriate value before using any other UltraLite.NET API.
The following example selects the UltraLite Engine runtime and creates a connection:
// C#
ULDatabaseManager.RuntimeType = ULRuntimeType.UL_ENGINE_CLIENT;
ULConnection conn = new ULConnection();
// The RuntimeType is now locked
In this section:
Syntax
Visual Basic
C#
Parameters
connString The parameters for identifying a database in the form of a semicolon-separated list of
keyword=value pairs.
createParms The parameters used to configure the new database in the form of a semicolon-separated list
of keyword=value pairs.
Exceptions
Example
The following code creates the database \UltraLite\MyDatabase.udb on a Windows Mobile device then
opens a connection to it.
// C#
ULConnectionParms openParms = new ULConnectionParms();
openParms.DatabaseOnDevice = ".udb";
ULDatabaseManager.CreateDatabase(
openParms.ToString(),
""
);
ULConnection conn = new ULConnection( openParms.ToString() );
conn.Open();
Related Information
Syntax
Visual Basic
C#
Parameters
connString The parameters for identifying a database in the form of a semicolon-separated list of
keyword=value pairs.
Exceptions
Remarks
Example
The following code creates the database \UltraLite\MyDatabase.udb on a Windows Mobile device then
opens a connection to it:
// C#
Related Information
4.1.13.3 SetActiveSyncListener(string,
ULActiveSyncListener) method
Specifies the listener object used to process Microsoft ActiveSync calls from the MobiLink provider for
Microsoft ActiveSync.
Syntax
C#
Parameters
appClassName The unique class name for the application. This is the class name used when the
application is registered for use with Microsoft ActiveSync.
listener The ULActiveSyncListener object. Use null (Nothing in Microsoft Visual Basic) to remove the
previous listener.
Remarks
The appClassName parameter is the unique identifier used to identify the application. The application can only
use one appClassName value at a time. While a listener is registered with a particular appClassName value,
calls to the SetServerSyncListener or SetActiveSyncListener methods with a different appClassName value
fail.
To remove the Microsoft ActiveSync listener, call the SetActiveSyncListener method with a null reference
(Nothing in Microsoft Visual Basic) as the listener parameter.
To remove all listeners, call the SetServerSyncListener method with a null reference (Nothing in Microsoft
Visual Basic) for all parameters.
Related Information
Specifies the listener object used to process the specified server synchronization message.
Syntax
Visual Basic
C#
Parameters
Exceptions
Remarks
The appClassName parameter is the unique identifier used to identify the application. The application may only
use one appClassName value at a time. While a listener is registered with a particular appClassName value,
calls to the SetServerSyncListener or SetActiveSyncListener methods with a different appClassName value
fail.
To remove the listener for a particular message, call the SetServerSyncListener method with a null reference
(Nothing in Visual Basic) as the listener parameter.
To remove all listeners, call the SetServerSyncListener method with a null reference (Nothing in Visual Basic)
for all parameters.
Related Information
Signals the MobiLink provider for ActiveSync that an application has completed synchronization.
Syntax
Visual Basic
C#
Related Information
Syntax
Visual Basic
C#
Parameters
start_parms The parameters for identifying a database in the form of a semicolon-separated list of
keyword=value pairs.
how Describes how to validate the database.
Example
The following code validates indexes for the database \UltraLite\MyDatabase.udb under Windows Mobile:
// C#
ULConnectionParms openParms = new ULConnectionParms();
openParms.DatabaseOnDevice = ".udb";
ULConnection.DatabaseManager.ValidateDatabase(
openParms.ToString(), Sap.Data.UltraLite.ULVF_INDEX );
Related Information
Syntax
Visual Basic
C#
The runtime type must be selected before using any other UltraLite.NET API.
Example
The following example selects the UltraLite Engine runtime and creates a connection:
// C#
ULDatabaseManager.RuntimeType = ULRuntimeType.UL_ENGINE_CLIENT;
ULConnection conn = new ULConnection();
// The RuntimeType is now locked
Related Information
Syntax
Visual Basic
C#
Members
public string GetDatabaseProperty(string) [page Returns the value of the specified data
294] base property.
public string GetPublicationName(int) [page 296] Returns the name of the publication
identified by the specified publication
ID.
public string GetTableName(int) [page 297] Returns the name of the table identified
by the specified table ID.
public void SetDatabaseOption(string, string) Sets the value for the specified data
[page 298] base option.
Properties
public unsafe bool IsCaseSensitive [page 300] Checks whether the database is case
sensitive.
public unsafe int PublicationCount [page 301] Counts the number of publications in
the database.
public unsafe int TableCount [page 302] Counts the number of tables in the da
tabase.
Remarks
There is no constructor for this class. A ULDatabaseSchema object is attached to a connection as its
ULConnection.Schema object and is only valid while that connection is open.
In this section:
Related Information
Syntax
Visual Basic
C#
Parameters
name The name of the database property whose value you want to obtain. Property names are case
insensitive.
Returns
Exceptions
Property Description
ChecksumLevel The level of database page checksums enabled for the data
base.
date_format The date format used for string conversions by the data
base. This format is not necessarily the same as the one
used by System.DateTime.
date_order The date order used for string conversions by the database.
nearest_century The nearest century used for string conversions by the data
base.
scale The minimum number of digits after the decimal point when
an arithmetic result is truncated to the maximum PRECI
SION value during string conversions by the database.
time_format The time format used for string conversions by the data
base. This format is not necessarily the same as the one
used by System.TimeSpan.
timestamp_format The timestamp format used for string conversions by the da
tabase. This format is not necessarily the same as the one
used by System.DateTime.
Related Information
Returns the name of the publication identified by the specified publication ID.
Syntax
Visual Basic
C#
Parameters
pubID The ID of the publication. The value must be in the range [1,PublicationCount].
Returns
Remarks
Note
Publication IDs and counts may change during a schema upgrade. To correctly identify a publication,
access it by name or refresh the cached IDs and counts after a schema upgrade.
Related Information
Returns the name of the table identified by the specified table ID.
Syntax
Visual Basic
C#
Parameters
Returns
Remarks
Table IDs may change during a schema upgrade. To correctly identify a table, access it by name or refresh the
cached IDs after a schema upgrade.
Related Information
Syntax
Visual Basic
C#
Parameters
name The name of the database option. Option names are case insensitive.
value The new value for the option.
Remarks
Using this method while a transaction is active may cause unpredictable results and is not recommended. The
call changes the isolation level of the connection, but does not update the ULTransaction.IsolationLevel value.
Option Description
global_database_id The value used for global autoincrement columns. The value
must be in the range [0,System.UInt32.MaxValue]. The de
fault is the ULConnection.INVALID_DATABASE_ID value
(used to indicate that the database ID has not been set for
the current database).
isolation_level The value used to control the degree to which the operations
in one transaction are visible to the operations in other con
current transactions. The value must be one of "read_un
committed" or "read_committed". The default is "read_com
mitted". Setting the isolation_level on a connection to
"read_uncommitted" is equivalent to wrapping all operations
on that connection with BeginTransaction(System.Data.Iso
lationLevel.ReadUncommitted) and Commit() calls. Simi
larly, "read_committed" is equivalent to System.Data.Isola
tionLevel.ReadCommitted. SetDatabaseOption() should not
be used to set the current transaction's isolation level; use
BeginTransaction(IsolationLevel) instead. UltraLite's defini
tion of each isolation level is slightly different than
ADO.NET's documentation of IsolationLevel. This value is set
on a per connection basis.
ml_remote_id The value used for identifying the database during synchro
nization. Use a null reference (Nothing in Visual Basic) as the
value to remove the ml_remote_id option from the database.
Related Information
Syntax
Visual Basic
C#
Remarks
True if the database is case sensitive, and false if the database is case insensitive.
Database case sensitivity affects how indexes on tables and result sets are sorted. Case sensitivity also affects
how the ULConnectionParms.UserID and ULConnectionParms.Password values are verified.
Related Information
Syntax
Visual Basic
C#
True if this database schema is currently open, false if this database schema is currently closed.
Syntax
Visual Basic
C#
Remarks
Note
Publication IDs and counts may change during a schema upgrade. To correctly identify a publication,
access it by name or refresh the cached IDs and counts after a schema upgrade.
Related Information
Syntax
Visual Basic
C#
Remarks
Note
Table IDs and counts may change during a schema upgrade. To correctly identify a table, access it by name
or refresh the cached IDs and counts after a schema upgrade.
Syntax
Visual Basic
C#
Members
public override unsafe bool GetBoolean(int) [page 310] Returns the value for the specified col
umn as a System.Boolean.
public override unsafe byte GetByte(int) [page 311] Returns the value for the specified col
umn as an unsigned 8-bit value (Sys
tem.Byte).
public unsafe byte[] GetBytes [page 312] UL Ext: Returns the value for the speci
fied column as an array of Sys
tem.Bytes values.
public override char GetChar(int) [page 315] This method is not supported in Ultra
Lite.NET.
public override unsafe long GetChars(int, long, char[], int, int) Copies a subset of the value for the
[page 316] specified ULDbType.LongVarchar col
umn, beginning at the specified offset,
to the specified offset of the destination
System.Char array.
public override string GetDataTypeName(int) [page 317] Returns the name of the specified col
umn's provider data type.
public override unsafe DateTime GetDateTime(int) [page 318] Returns the value for the specified col
umn as a System.DateTime type with
millisecond accuracy.
public override decimal GetDecimal(int) [page 319] Returns the value for the specified col
umn as a System.Decimal type.
public override unsafe double GetDouble(int) [page 320] Returns the value for the specified col
umn as a System.Double type.
public override Type GetFieldType(int) [page 321] Returns the System.Type value most
appropriate for the specified column.
public override unsafe float GetFloat(int) [page 322] Returns the value for the specified col
umn as a System.Single type.
public override unsafe Guid GetGuid(int) [page 323] Returns the value for the specified col
umn as a UUID (System.Guid) type.
public override unsafe short GetInt16(int) [page 324] Returns the value for the specified col
umn as a System.Int16 type.
public override unsafe int GetInt32(int) [page 325] Returns the value for the specified col
umn as a System.Int32 type.
public override unsafe long GetInt64(int) [page 326] Returns the value for the specified col
umn as a System.Int64 type.
public override string GetName(int) [page 327] Returns the name of the specified col
umn.
public override unsafe int GetOrdinal(string) [page 328] Returns the column ID of the named
column.
public unsafe int GetRowCount(int) [page 329] UL Ext: Returns the number of rows in
the cursor, within threshold.
public override unsafe String GetString(int) [page 332] Returns the value for the specified col
umn as a System.String type.
public unsafe TimeSpan GetTimeSpan(int) [page 333] Returns the value for the specified col
umn as a System.TimeSpan type with
millisecond accuracy.
public unsafe ushort GetUInt16(int) [page 334] Returns the value for the specified col
umn as a System.UInt16 type.
public unsafe uint GetUInt32(int) [page 335] Returns the value for the specified col
umn as a System.UInt32 type.
public unsafe ulong GetUInt64(int) [page 336] Returns the value for the specified col
umn as a System.UInt64 type.
public override object GetValue(int) [page 337] Returns the value of the specified col
umn in its native format.
public override int GetValues(object[]) [page 338] Returns all the column values for the
current row.
public override unsafe bool IsDBNull(int) [page 339] Checks whether the value from the
specified column is NULL.
public void MoveAfterLast() [page 340] UL Ext: Positions the cursor to after the
last row of the cursor.
public void MoveBeforeFirst() [page 340] UL Ext: Positions the cursor to before
the first row of the cursor.
public unsafe bool MoveFirst() [page 341] UL Ext: Positions the cursor to the first
row of the cursor.
public unsafe bool MoveLast() [page 341] UL Ext: Positions the cursor to the last
row of the cursor.
public unsafe bool MoveNext() [page 342] UL Ext: Positions the cursor to the next
row or after the last row if the cursor
was already on the last row.
public unsafe bool MovePrevious() [page 343] UL Ext: Positions the cursor to the pre
vious row or before the first row.
public unsafe bool MoveRelative(int) [page 343] UL Ext: Positions the cursor relative to
the current row.
public override bool NextResult() [page 344] Advances the ULDataReader object to
the next result when reading the results
of batch SQL statements.
public override bool Read() [page 345] Positions the cursor to the next row, or
after the last row if the cursor was al
ready on the last row.
Properties
public override int Depth [page 347] Returns the depth of nesting for the
current row.
public override int FieldCount [page 347] Returns the number of columns in the
cursor.
public override unsafe bool HasRows [page 348] Checks whether the ULDataReader ob
ject has one or more rows.
public unsafe bool IsBOF [page 348] UL Ext: Checks whether the current row
position is before the first row.
public override bool IsClosed [page 349] Checks whether the cursor is currently
open.
public unsafe bool IsEOF [page 349] UL Ext: Checks whether the current row
position is after the last row.
public override int RecordsAffected [page 350] Returns the number of rows changed,
inserted, or deleted by execution of the
SQL statement.
public int RowCount [page 350] UL Ext: Returns the number of rows in
the cursor.
public ULCursorSchema Schema [page 351] UL Ext: Holds the schema of this cursor.
public override object this [page 352] Returns the value of the specified col
umn in its native format.
Remarks
Cursors are sets of rows from either a table or the result set from a query.
There is no constructor for the ULDataReader class. To get a ULDataReader object, execute a ULCommand
object:
// C#
ULCommand cmd = new ULCommand(
"SELECT emp_id FROM employee", conn
);
ULDataReader reader = cmd.ExecuteReader();
UL Ext: The ADO.NET standard only requires forward-only motion through the result set, but ULDataReader
objects are bi-directional. ULDataReader's Move methods provide you with full flexibility when moving through
results.
A ULDataReader object is a read-only result set. If you need a more flexible object to manipulate results, use
the ULCommand.ExecuteResultSet method, the ULCommand.ExecuteTable method, or the ULDataAdapter
class. The ULDataReader class retrieves rows as needed, whereas the ULDataAdapter class must retrieve all
rows of a result set before you can carry out any action on the object. For large result sets, this difference gives
the ULDataReader class a much faster response time.
UL Ext: All columns of a ULDataReader object may be retrieved using the GetString method.
In this section:
Related Information
Syntax
Visual Basic
C#
Exceptions
Remarks
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Returns
Exceptions
Related Information
Returns the value for the specified column as an unsigned 8-bit value (System.Byte).
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Returns
Exceptions
Related Information
UL Ext: Returns the value for the specified column as an array of System.Bytes values.
Overload list
public unsafe byte[] GetBytes(int) [page 312] UL Ext: Returns the value for the speci
fied column as an array of Sys
tem.Bytes values.
public override unsafe long GetBytes(int, long, byte[], int, int) [page Copies a subset of the value for the
313] specified ULDbType.LongBinary col
umn, beginning at the specified offset,
to the specified offset of the destination
System.Byte array.
In this section:
UL Ext: Returns the value for the specified column as an array of System.Bytes values.
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Exceptions
Remarks
Related Information
Copies a subset of the value for the specified ULDbType.LongBinary column, beginning at the specified offset,
to the specified offset of the destination System.Byte array.
Syntax
Visual Basic
C#
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
srcOffset The start position in the column value. Zero is the beginning of the value.
dst The destination array.
dstOffset The start position in the destination array.
count The number of bytes to be copied.
Returns
Exceptions
Remarks
If you pass a dst buffer that is a null reference (Nothing in Visual Basic), the GetBytes method returns the
length of the field in bytes.
The bytes at the srcOffset through srcOffset +count -1 positions of the value are copied into the dstOffset
through dstOffset +count -1 positions, respectively, of the destination array. If the end of the value is
encountered before count bytes are copied, the remainder of the destination array is left unchanged.
If any of the following are true, a ULException object with code ULSQLCode.SQLE_INVALID_PARAMETER is
thrown and the destination is not modified:
● srcOffset is negative.
● dstOffset is negative.
● count is negative.
● dstOffset +count is greater than the dst length.
For other errors, a ULException object with the appropriate error code is thrown.
Related Information
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Returns
Exceptions
Related Information
Copies a subset of the value for the specified ULDbType.LongVarchar column, beginning at the specified offset,
to the specified offset of the destination System.Char array.
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
srcOffset The start position in the column value. Zero is the beginning of the value.
dst The destination array.
dstOffset The start position in the destination array.
count The number of characters to be copied.
Returns
Exceptions
If you pass a dst buffer that is a null reference (Nothing in Visual Basic), the GetChars method returns the
length of the field in characters.
The characters at the srcOffset through srcOffset +count -1 positions of the value are copied into the dstOffset
through dstOffset +count -1 positions, respectively, of the destination array. If the end of the value is
encountered before count characters are copied, the remainder of the destination array is left unchanged.
If any of the following instances are true, a ULException object with code
ULSQLCode.SQLE_INVALID_PARAMETER constant is thrown and the destination is not modified:
For other errors, a ULException object with the appropriate error code is thrown.
Related Information
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Exceptions
Related Information
Returns the value for the specified column as a System.DateTime type with millisecond accuracy.
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Returns
Related Information
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Exceptions
Related Information
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Returns
Related Information
Syntax
Visual Basic
C#
Returns
Returns the System.Type value most appropriate for the specified column.
Syntax
Visual Basic
C#
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Returns
Exceptions
Related Information
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Exceptions
Related Information
Returns the value for the specified column as a UUID (System.Guid) type.
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Returns
Remarks
This method is only valid for columns of the ULDbType.UniqueIdentifier type or the ULDbType.Binary type with
length 16.
Related Information
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Exceptions
Related Information
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Returns
Related Information
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Returns
Exceptions
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Returns
The name of the column or a null reference (Nothing in Visual Basic) if the column has no name. If the column
is aliased in the SQL query, the alias is returned.
Exceptions
In result sets, not all columns have names and not all column names are unique. If you are not using aliases, the
name of a non-computed column is prefixed with the name of the table the column is from. For example, the
MyTable.ID value is the name of the only column in the result set for the "SELECT ID FROM MyTable" query.
Related Information
Syntax
Visual Basic
C#
Parameters
Returns
Remarks
In result sets, not all columns have names and not all column names are unique. If you are not using aliases, the
name of a non-computed column is prefixed with the name of the table the column is from. For example, the
MyTable.ID value is the name of the only column in the result set for the "SELECT ID FROM MyTable" query.
Column IDs and counts may change during a schema upgrade. To correctly identify a column, access it by
name or refresh the cached IDs and counts after a schema upgrade.
Related Information
Syntax
Visual Basic
C#
Parameters
Remarks
The RowCount property is expensive with complex queries, as it requires passing through the cursor rows. By
using the GetRowCount( threshold ) method, the caller can determine if there are at least threshold rows. If the
number of rows is below the threshold, that number is returned; otherwise, threshold is returned. This can be
called again with a higher threshold.
Related Information
Returns a System.Data.DataTable value that describes the column metadata of the ULDataReader object.
Syntax
Visual Basic
C#
Returns
The GetSchemaTable method returns metadata about each column in the following order:
ColumnSize For sized columns, the maximum length of a value in the col
umn. For other columns, this is the size in bytes of the data
type.
IsKey True if the column is one of a set of columns in the result set
that taken together from a unique key for the result set. The
set of columns with the IsKey value set to true does not need
to be the minimal set that uniquely identifies a row in the re
sult set.
BaseCatalogName The name of the catalog in the database that contains the
column. For UltraLite.NET, this value is always DBNull.
BaseSchemaName The name of the schema in the database that contains the
column. For UltraLite.NET, this value is always DBNull.
BaseTableName The name of the table in the database that contains the col
umn, or DBNull if column is computed or if this information
cannot be determined.
DataType The .NET data type that is most appropriate for this type of
column.
AllowDBNull True if the column is nullable, false if the column is not nulla
ble or if this information cannot be determined.
Related Information
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Exceptions
Related Information
Returns the value for the specified column as a System.TimeSpan type with millisecond accuracy.
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Returns
Related Information
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Returns
Exceptions
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Returns
Exceptions
Related Information
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Returns
Exceptions
Related Information
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Returns
The column value as the .NET type most appropriate for the column or the DBNull type if column is NULL.
Exceptions
Remarks
Related Information
Syntax
Visual Basic
C#
Parameters
Returns
The number of column values retrieved. If the length of the array is greater than the number of columns
(ULDataReader.FieldCount), only FieldCount items are retrieved and the rest of the array is left unchanged.
Exceptions
Remarks
For most applications, the GetValues method provides an efficient means for retrieving all columns, rather than
retrieving each column individually.
You can pass an System.Object array that contains fewer than the number of columns contained in the
resulting row. Only the amount of data the System.Object array holds is copied to the array. You can also pass
an System.Object array whose length is more than the number of columns contained in the resulting row.
This method returns the DBNull type for NULL database columns. For other columns, it returns the value of the
column in its native format.
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Returns
Exceptions
Related Information
UL Ext: Positions the cursor to after the last row of the cursor.
Syntax
Visual Basic
C#
Exceptions
UL Ext: Positions the cursor to before the first row of the cursor.
Syntax
Visual Basic
C#
Exceptions
Syntax
Visual Basic
C#
Returns
True if successful, false otherwise. For example, the method fails if there are no rows.
Exceptions
Syntax
Visual Basic
C#
Returns
True if successful, false otherwise. For example, the method fails if there are no rows.
UL Ext: Positions the cursor to the next row or after the last row if the cursor was already on the last row.
Syntax
Visual Basic
C#
Returns
True if successful, false otherwise. For example, the method fails if there are no more rows.
Exceptions
Remarks
Related Information
UL Ext: Positions the cursor to the previous row or before the first row.
Syntax
Visual Basic
C#
Returns
True if successful, false otherwise. For example, the method fails if there are no more rows.
Exceptions
Syntax
Visual Basic
C#
Parameters
offset The number of rows to move. Negative values correspond to moving backward.
True if successful, false otherwise. For example, the method fails if it positions beyond the first or last row.
Exceptions
Remarks
If the row does not exist, the method returns false, and the cursor position is after the last row (the
ULDataReader.IsEOF method) if offset value is positive, and before the first row (the ULDataReader.IsBOF
method) if the offset value is negative.
Related Information
Advances the ULDataReader object to the next result when reading the results of batch SQL statements.
Syntax
Visual Basic
C#
Returns
True if there are more result sets, false otherwise. For UltraLite.NET, always returns false.
Remarks
UL Ext: UltraLite.NET does not support batches of SQL statements, so the ULDataReader object is always
positioned on the first and only result set. NextResult method calls have no effect.
Positions the cursor to the next row, or after the last row if the cursor was already on the last row.
Syntax
Visual Basic
C#
Returns
True if successful, false otherwise. For example, the method fails if there are no more rows.
Exceptions
Remarks
Overload list
In this section:
Syntax
Visual Basic
C#
Syntax
Visual Basic
Syntax
Visual Basic
C#
Remarks
Syntax
Visual Basic
C#
Returns
The number of columns in the cursor as an integer. Returns 0 if the cursor is closed.
Related Information
Syntax
Visual Basic
C#
Remarks
True if the result set has at least one row, false if there are no rows.
UL Ext: Checks whether the current row position is before the first row.
Syntax
Visual Basic
C#
True if the current row position is before the first row, false otherwise.
Syntax
Visual Basic
C#
Remarks
UL Ext: Checks whether the current row position is after the last row.
Syntax
Visual Basic
C#
Remarks
True if the current row position is after the last row, false otherwise.
Returns the number of rows changed, inserted, or deleted by execution of the SQL statement.
Syntax
Visual Basic
C#
Remarks
The number of rows changed, inserted, or deleted by execution of the SQL statement.
Syntax
Visual Basic
C#
Remarks
You can use the RowCount method to decide when to delete old rows to save space. Old rows can be deleted
from the UltraLite database without being deleted from the consolidated database using the
ULConnection.StopSynchronizationDelete method.
Syntax
Visual Basic
C#
Remarks
For result sets, the ULResultSetSchema object representing the schema of the result set. For tables, the
ULTableSchema object representing the schema of the table.
This property represents the complete schema of the cursor, including UltraLite.NET extended information
which is not represented in the results from the ULDataReader.GetSchemaTable method.
Related Information
Overload list
public override object this[int colID] [page 352] Returns the value of the specified col
umn in its native format.
public override object this[string name] [page 353] Returns the value of the specified
named column in its native format.
In this section:
Syntax
Visual Basic
C#
Returns
The column value as the .NET type most appropriate for the column or DBNull if column is NULL.
Related Information
Returns the value of the specified named column in its native format.
Syntax
Visual Basic
C#
Returns
The column value as the .NET type most appropriate for the column or DBNull if column is NULL.
Remarks
In result sets, not all columns have names and not all column names are unique. If you are not using aliases, the
name of a non-computed column is prefixed with the name of the table the column is from. For example, the
MyTable.ID value is the name of the only column in the result set for the query "SELECT ID FROM MyTable".
When accessing columns multiple times, it is more efficient to access columns by column ID than by name.
Related Information
Syntax
Visual Basic
C#
Members
public ULSQLCode NativeError [page 355] Returns the SQLCODE value returned
by the database.
public override string Source [page 355] Returns the name of the provider that
generated the error.
Remarks
Related Information
Syntax
Visual Basic
C#
Remarks
Syntax
Visual Basic
C#
Represents a set of methods for creating instances of the Sap.Data.UltraLite provider's implementation of the
data source classes.
Syntax
Visual Basic
C#
Members
Variables
Methods
public override DbCommand CreateCommand() [page 358] Returns a strongly typed Sys
tem.Data.Common.DbCommand in
stance.
public override DbCommandBuilder CreateCommandBuilder() [page 359] Returns a strongly typed Sys
tem.Data.Common.DbCommand
Builder instance.
public override DbConnection CreateConnection() [page 359] Returns a strongly typed Sys
tem.Data.Common.DbConnection in
stance.
public override DbDataAdapter CreateDataAdapter() [page 360] Returns a strongly typed Sys
tem.Data.Common.DbDataAdapter in
stance.
public override DbParameter CreateParameter() [page 361] Returns a strongly typed Sys
tem.Data.Common.DbParameter in
stance.
Properties
Remarks
The ULFactory class is not available in the .NET Compact Framework 2.0.
ADO.NET 2.0 adds two new classes, the System.Data.Common.DbProviderFactories class and the
System.Data.Common.DbProviderFactory class, to make provider independent code easier to write. To use
them with UltraLite.NET specify Sap.Data.UltraLite as the provider invariant name passed to the GetFactory
method. For example:
// C#
DbProviderFactory factory =
DbProviderFactories.GetFactory( "Sap.Data.UltraLite" );
DbConnection conn = factory.CreateConnection();
In this section:
Syntax
Visual Basic
C#
Returns
Related Information
Syntax
Visual Basic
C#
Returns
Related Information
Syntax
Visual Basic
C#
Returns
Syntax
Visual Basic
C#
Returns
Related Information
Syntax
Visual Basic
C#
Related Information
Syntax
Visual Basic
C#
Returns
Related Information
Returns false to indicate the UltraLite.NET does not support the DbDataSourceEnumerator class.
Syntax
Visual Basic
Remarks
False to indicate that the ULFactory class does not implement the CreateDataSourceEnumerator method.
UL Ext: Transfers a file from a remote database using the MobiLink server.
Syntax
Visual Basic
C#
Members
Constructors
Methods
public bool DownloadFile [page 366] Download the file specified by the prop
erties of this object.
public bool UploadFile [page 369] Upload the file specified by the proper
ties of this object.
Properties
public unsafe String[] AuthenticationParms [page 372] Specifies parameters for a custom user
authentication script (MobiLink authen
ticate_parameters connection event).
public ULAuthStatusCode AuthStatus [page 373] Returns the authorization status code
for the last file transfer attempt.
public long AuthValue [page 373] Returns the return value from custom
user authentication synchronization
scripts.
public ushort FileAuthCode [page 374] Returns the return value from the au
thenticate_file_transfer script for the
last file transfer attempt.
public string FileName [page 374] Specifies the name of the file to down
load.
public string LocalFileName [page 375] Specifies the local file name for the
downloaded file.
public string LocalPath [page 376] Specifies where to download the file.
public string Password [page 376] The MobiLink password for the user
specified by the UserName value.
public string RemoteKey [page 377] The key that uniquely identifies the Mo
biLink client to the MobiLink server.
public ULStreamErrorCode StreamErrorCode [page 379] Returns the error reported by the
stream itself for the last file transfer at
tempt.
public int StreamErrorSystem [page 380] Returns the stream error system-spe
cific code.
public bool TransferredFile [page 381] Checks whether the file was actually
downloaded during the last file transfer
attempt.
public string UserName [page 382] The user name that identifies the Mobi
Link client to the MobiLink server.
You do not need a database connection to perform a file transfer, however, if your application uses an UltraLite
database with the UltraLite Engine runtime, you must set the ULDatabaseManager.RuntimeType value to the
appropriate value before using this API or any other UltraLite.NET API.
In this section:
Related Information
Syntax
Visual Basic
C#
public ULFileTransfer ()
Remarks
The connection must be opened before you can perform any operations against the database.
You do not need a database connection to perform a file transfer, however, if your application uses an UltraLite
database with the UltraLite Engine runtime, you must set the ULDatabaseManager.RuntimeType value to the
appropriate value before using this API or any other UltraLite.NET API.
Overload list
public bool DownloadFile() [page 366] Download the file specified by the prop
erties of this object.
In this section:
Syntax
Visual Basic
Returns
True if successful, false otherwise (check the ULFileTransfer.StreamErrorCode value and other status
properties for reason).
Remarks
The file specified by the ULFileTransfer.FileName value is downloaded by the MobiLink server to the
ULFileTransfer.LocalPath value using the ULFileTransfer.Stream, ULFileTransfer.UserName,
ULFileTransfer.Password, and ULFileTransfer.Version values.
To avoid file corruption, UltraLite.NET downloads to a temporary file and only replaces the local file once the
download has completed. Other properties that affect the download are: ULFileTransfer.LocalFileName,
ULFileTransfer.AuthenticationParms, and ULFileTransfer.ResumePartialDownload.
Related Information
4.1.18.2.2 DownloadFile(ULFileTransferProgressListener)
method
Download the file specified by the properties of this object with progress events posted to the specified listener.
Syntax
Visual Basic
C#
Parameters
Returns
True if successful, false otherwise (check the ULFileTransfer.StreamErrorCode value and other status
properties for reason).
Remarks
The file specified by the ULFileTransfer.FileName value is downloaded by the MobiLink server to the
ULFileTransfer.LocalPath value using the ULFileTransfer.Stream, ULFileTransfer.UserName,
ULFileTransfer.Password, and ULFileTransfer.Version values.
To avoid file corruption, UltraLite.NET downloads to a temporary file and only replaces the local file once the
download has completed. Other properties that affect the download are: ULFileTransfer.LocalFileName,
ULFileTransfer.AuthenticationParms, and ULFileTransfer.ResumePartialDownload.
Overload list
public bool UploadFile() [page 370] Upload the file specified by the proper
ties of this object.
In this section:
Syntax
Visual Basic
C#
Returns
True if successful, false otherwise (check the ULFileTransfer.StreamErrorCode value and other status
properties for reason).
Remarks
The file specified by the ULFileTransfer.FileName value is uploaded to the MobiLink server from the
ULFileTransfer.LocalPath value using the ULFileTransfer.Stream, ULFileTransfer.UserName,
ULFileTransfer.Password, and ULFileTransfer.Version values.
Related Information
4.1.18.3.2 UploadFile(ULFileTransferProgressListener)
method
Upload the file specified by the properties of this object with progress events posted to the specified listener.
Syntax
Visual Basic
C#
Parameters
Returns
True if successful, false otherwise (check the ULFileTransfer.StreamErrorCode value and other status
properties for reason).
Remarks
The file specified by the ULFileTransfer.FileName value is uploaded to the MobiLink server from the
ULFileTransfer.LocalPath value using the ULFileTransfer.Stream, ULFileTransfer.UserName,
ULFileTransfer.Password, and ULFileTransfer.Version values.
Related Information
Specifies parameters for a custom user authentication script (MobiLink authenticate_parameters connection
event).
Syntax
Visual Basic
C#
Remarks
An array of strings, each containing an authentication parameter (null array entries result in a synchronization
error). The default is a null reference (Nothing in Visual Basic), meaning no authentication parameters.
Returns the authorization status code for the last file transfer attempt.
Syntax
Visual Basic
C#
Remarks
One of the ULAuthStatusCode values denoting the authorization status for the last file transfer attempt.
Related Information
Returns the return value from custom user authentication synchronization scripts.
Syntax
Visual Basic
C#
Returns the return value from the authenticate_file_transfer script for the last file transfer attempt.
Syntax
Visual Basic
C#
Remarks
An unsigned short integer returned from the authenticate_file_transfer script for the last file transfer attempt.
Syntax
Visual Basic
C#
Remarks
A string specifying the name of the file as recognized by the MobiLink server. This property has no default
value, and must be explicitly set.
The FileName value is the name of the file on the server running MobiLink. MobiLink first searches for this file in
the UserName subdirectory and then in the root directory (the root directory is specified via the MobiLink
Related Information
Syntax
Visual Basic
C#
Remarks
A string specifying the local file name for the downloaded file. The FileName value is used if the value is a null
reference (Nothing in Visual Basic). The default is a null reference (Nothing in Visual Basic).
Related Information
Syntax
Visual Basic
C#
Remarks
A string specifying the local directory of the file. The default is a null reference (Nothing in Visual Basic).
The default local directory varies depending on the device's operating system:
● For Windows Mobile devices, if the LocalPath value is a null reference (Nothing in Visual Basic), the file is
stored in the root (\) directory.
● For desktop applications, if the LocalPath value is a null reference (Nothing in Visual Basic), the file is
stored in the current directory.
Related Information
The MobiLink password for the user specified by the UserName value.
Syntax
Visual Basic
C#
A string specifying the MobiLink password. The default is a null reference (Nothing in Visual Basic), meaning no
password is specified.
The MobiLink user name and password are separate from any database user ID and password, and serve to
identify and authenticate the application to the MobiLink server.
Related Information
The key that uniquely identifies the MobiLink client to the MobiLink server.
Syntax
Visual Basic
C#
Remarks
A string specifying the remote key. This property has no default value, and must be explicitly set.
The MobiLink server passes this value to various scripts to uniquely identify this client.
Related Information
Syntax
Visual Basic
C#
Remarks
True to resume a previous partial download, false to discard a previous partial download. The default is false.
UltraLite.NET can use the ULFileTransferListener object to restart downloads that fail because of
communication errors or user aborts. UltraLite.NET processes the download as it is received. If a download is
interrupted, then the partially download file is retained and can be resumed during the next file transfer.
If the file has been updated on the server, a partial download is discarded and a new download starts.
Related Information
Specifies the MobiLink synchronization stream to use for the file transfer.
Syntax
Visual Basic
C#
One of the ULStreamType values specifying the type of synchronization stream to use. The default is the
ULStreamType.TCPIP value.
Most synchronization streams require parameters to identify the MobiLink server address and control other
behavior. These parameters are supplied by the ULFileTransfer.StreamParms value.
If the stream type is set to a value that is invalid for the platform, the stream type is set to the
ULStreamType.TCPIP value.
Related Information
Returns the error reported by the stream itself for the last file transfer attempt.
Syntax
Visual Basic
C#
Remarks
One of the ULStreamErrorCode values denoting the error reported by the stream itself. The
ULStreamErrorCode.NONE value if no error occurred.
Syntax
Visual Basic
C#
Remarks
Syntax
Visual Basic
C#
Remarks
A string, in the form of a semicolon-separated list of keyword=value pairs, specifying the parameters for the
stream. The default is a null reference. (Nothing in Visual Basic)
The StreamParms value is a string containing all the parameters used for synchronization streams. Parameters
are specified as a semicolon-separated list of name=value pairs ("param1=value1;param2=value2").
Checks whether the file was actually downloaded during the last file transfer attempt.
Syntax
Visual Basic
C#
Remarks
If the file is already up-to-date when the DownloadFile or UploadFile method is invoked, it returns true, but
TransferredFile is false. If an error occurs and the DownloadFile or UploadFile method returns false, then
TransferredFile is false.
Related Information
The user name that identifies the MobiLink client to the MobiLink server.
Syntax
Visual Basic
C#
Remarks
A string specifying the user name. This property has no default value, and must be explicitly set.
The MobiLink server uses this value to locate the file to download. The MobiLink user name and password are
separate from any database user ID and password, and serve to identify and authenticate the application to the
MobiLink server.
Related Information
Syntax
Visual Basic
C#
A string specifying the version of the synchronization script to use. This property has no default value, and
must be explicitly set.
Each synchronization script in the consolidated database is marked with a version string. The version string
allows an UltraLite application to choose from a set of synchronization scripts.
Related Information
Syntax
Visual Basic
C#
Members
public const int FLAG_IS_BLOCKING A flag indicating that the file transfer is
blocked awaiting a response from the
MobiLink server.
Properties
public ulong BytesReceived [page 384] Returns the number of bytes received
so far.
public ulong FileSize [page 385] Returns the size of the file being trans
ferred.
public int Flags [page 385] Returns the current file transfer flags
indicating additional information relat
ing to the current state.
public ulong ResumedAtSize [page 386] Returns the point in the file where the
transfer was resumed.
In this section:
Related Information
Syntax
Visual Basic
C#
Remarks
Syntax
Visual Basic
C#
Remarks
Returns the current file transfer flags indicating additional information relating to the current state.
Syntax
Visual Basic
C#
Remarks
Returns the point in the file where the transfer was resumed.
Syntax
Visual Basic
C#
Remarks
UL Ext: The listener interface for receiving file transfer progress events.
Syntax
Visual Basic
C#
Members
In this section:
Related Information
4.1.20.1 FileTransferProgressed(ULFileTransferProgressData)
method
Syntax
Visual Basic
C#
Parameters
data A ULFileTransferProgressData object containing the latest file transfer progress data.
Returns
This method should return true to cancel the transfer or return false to continue.
Remarks
This method should return true to cancel the transfer or return false to continue.
Syntax
Visual Basic
C#
Members
Methods
public unsafe string GetColumnName(short) [page 390] Returns the name of the colOrdinalInIn
dex 'th column in this index.
public unsafe bool IsColumnDescending(string) [page Checks whether the named column is
391] used in descending order by the index.
Properties
public unsafe short ColumnCount [page 392] Returns the number of columns in the
index.
public unsafe bool IsForeignKey [page 393] Checks whether the index is a foreign
key.
public unsafe bool IsForeignKeyCheckOnCommit [page Checks whether referential integrity for
393] the foreign key is performed on com
mits or on inserts and updates.
public unsafe bool IsForeignKeyNullable [page 394] Checks whether the foreign key is nulla
ble.
public bool IsOpen [page 394] Determines whether the index schema
is open or closed.
public unsafe bool IsPrimaryKey [page 395] Checks whether the index is the pri
mary key.
public unsafe bool IsUniqueIndex [page 395] Checks whether the index is unique.
public unsafe bool IsUniqueKey [page 396] Checks whether the index is a unique
key.
public unsafe string Name [page 396] Returns the name of the index.
public unsafe string ReferencedIndexName [page 397] The name of the referenced primary in
dex if the index is a foreign key.
public unsafe string ReferencedTableName [page 397] The name of the referenced primary ta
ble if the index is a foreign key.
Remarks
There is no constructor for this class. Index schemas are created using the ULTableSchema.PrimaryKey,
ULTableSchema.GetIndex(string), and ULTableSchema.GetOptimalIndex(int) methods.
In this section:
Related Information
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
colOrdinalInIndex The ordinal of the desired column in the index. The value must be in the range
[1,ColumnCount].
Returns
Exceptions
Remarks
Column ordinals and count may change during a schema upgrade. Column ordinals from an index are different
than the column IDs in a table or another index, even if they refer to the same physical column in a particular
table.
Related Information
Checks whether the named column is used in descending order by the index.
Syntax
Visual Basic
C#
Returns
True if the column is used in descending order, false if the column is used in ascending order.
Exceptions
Related Information
Syntax
Visual Basic
C#
Remarks
Syntax
Visual Basic
C#
Remarks
True if the index is the foreign key, false if the index is not the foreign key.
Columns in a foreign key may reference another table's non-null, unique index.
Checks whether referential integrity for the foreign key is performed on commits or on inserts and updates.
Syntax
Visual Basic
C#
Remarks
True if referential integrity is checked on commits, false if it is checked on inserts and updates.
Syntax
Visual Basic
C#
Remarks
True if the foreign key is nullable, false if the foreign key is not nullable.
Related Information
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
Remarks
True if the index is the primary key, false if the index is not the primary key.
Syntax
Visual Basic
C#
Remarks
Syntax
Visual Basic
C#
Remarks
True if the index is a unique key, false if the index is not a unique key.
Syntax
Visual Basic
C#
Remarks
The name of the referenced primary index if the index is a foreign key.
Syntax
Visual Basic
C#
Remarks
Related Information
The name of the referenced primary table if the index is a foreign key.
Syntax
Visual Basic
C#
Remarks
Syntax
Visual Basic
C#
Members
public override string ToString() [page 399] The string representation of the ULCon
nection.InfoMessage event.
Properties
public ULSQLCode NativeError [page 400] The SQLCODE corresponding to the in
formational message or warning re
turned by the database.
public string Source [page 401] The name of the ADO.NET data pro
vider returning the message.
In this section:
Related Information
Syntax
Visual Basic
C#
Returns
Remarks
Related Information
Syntax
Visual Basic
C#
Remarks
The SQLCODE corresponding to the informational message or warning returned by the database.
Syntax
Visual Basic
C#
Remarks
Syntax
Visual Basic
C#
Remarks
Provides a list of constants for use with the ULConnection.GetSchema(String,String[]) method to retrieve
metadata collections.
Syntax
Visual Basic
C#
Members
public string Columns [page 403] Provides a constant for use with the UL
Connection.GetSchema(String)
method that represents the Columns
collection.
public string DataSourceInformation [page 404] Provides a constant for use with the UL
Connection.GetSchema(String)
method that represents the DataSour
ceInformation collection.
public string DataTypes [page 405] Provides a constant for use with the UL
Connection.GetSchema(String)
method that represents the DataTypes
collection.
public string ForeignKeys [page 406] Provides a constant for use with the UL
Connection.GetSchema(String)
method that represents the Foreign
Keys collection.
public string IndexColumns [page 407] Provides a constant for use with the UL
Connection.GetSchema(String)
method that represents the IndexCol
umns collection.
public string Indexes [page 408] Provides a constant for use with the UL
Connection.GetSchema(String)
method that represents the Indexes col
lection.
public string MetaDataCollections [page 409] Provides a constant for use with the UL
Connection.GetSchema(String)
method that represents the MetaData
Collections collection.
public string Publications [page 410] Provides a constant for use with the UL
Connection.GetSchema(String)
method that represents the Publica
tions collection.
public string ReservedWords [page 411] Provides a constant for use with the UL
Connection.GetSchema(String)
method that represents the Reserved
Words collection.
public string Restrictions [page 412] Provides a constant for use with the UL
Connection.GetSchema(String)
method that represents the Restric
tions collection.
public string Tables [page 413] Provides a constant for use with the UL
Connection.GetSchema(String)
method that represents the Tables col
lection.
In this section:
Provides a constant for use with the ULConnection.GetSchema(String) method that represents the Columns
collection.
Syntax
Visual Basic
C#
Example
The following code fills a DataTable object with the Columns collection.
// C#
DataTable schema =
conn.GetSchema( ULMetaDataCollectionNames.Columns );
Related Information
Provides a constant for use with the ULConnection.GetSchema(String) method that represents the
DataSourceInformation collection.
Syntax
Visual Basic
C#
Remarks
Example
The following code fills a DataTable object with the DataSourceInformation collection.
// C#
DataTable schema =
conn.GetSchema( ULMetaDataCollectionNames.DataSourceInformation );
Related Information
Provides a constant for use with the ULConnection.GetSchema(String) method that represents the DataTypes
collection.
Syntax
Visual Basic
C#
Remarks
Example
The following code fills a DataTable object with the DataTypes collection.
// C#
DataTable schema =
conn.GetSchema( ULMetaDataCollectionNames.DataTypes );
Provides a constant for use with the ULConnection.GetSchema(String) method that represents the
ForeignKeys collection.
Syntax
Visual Basic
C#
Remarks
Example
The following code fills a DataTable object with the ForeignKeys collection.
// C#
DataTable schema =
conn.GetSchema( ULMetaDataCollectionNames.ForeignKeys );
Related Information
Provides a constant for use with the ULConnection.GetSchema(String) method that represents the
IndexColumns collection.
Syntax
Visual Basic
C#
Remarks
Example
The following code fills a DataTable object with the IndexColumns collection.
// C#
DataTable schema =
conn.GetSchema( ULMetaDataCollectionNames.IndexColumns );
Related Information
Provides a constant for use with the ULConnection.GetSchema(String) method that represents the Indexes
collection.
Syntax
Visual Basic
C#
Remarks
Example
The following code fills a DataTable object with the Indexes collection.
// C#
DataTable schema =
conn.GetSchema( ULMetaDataCollectionNames.Indexes );
Related Information
Provides a constant for use with the ULConnection.GetSchema(String) method that represents the
MetaDataCollections collection.
Syntax
Visual Basic
C#
Remarks
Example
The following code fills a DataTable object with the MetaDataCollections collection.
// C#
DataTable schema =
conn.GetSchema( ULMetaDataCollectionNames.MetaDataCollections );
Related Information
Provides a constant for use with the ULConnection.GetSchema(String) method that represents the
Publications collection.
Syntax
Visual Basic
C#
Remarks
Example
The following code fills a DataTable object with the Publications collection.
// C#
DataTable schema =
conn.GetSchema( ULMetaDataCollectionNames.Publications );
Related Information
Provides a constant for use with the ULConnection.GetSchema(String) method that represents the
ReservedWords collection.
Syntax
Visual Basic
C#
Remarks
Example
The following code fills a DataTable object with the ReservedWords collection.
// C#
DataTable schema =
conn.GetSchema( ULMetaDataCollectionNames.ReservedWords );
Related Information
Provides a constant for use with the ULConnection.GetSchema(String) method that represents the
Restrictions collection.
Syntax
Visual Basic
C#
Remarks
Example
The following code fills a DataTable object with the Restrictions collection.
// C#
DataTable schema =
conn.GetSchema( ULMetaDataCollectionNames.Restrictions );
Related Information
Provides a constant for use with the ULConnection.GetSchema(String) method that represents the Tables
collection.
Syntax
Visual Basic
C#
Remarks
Example
The following code fills a DataTable object with the Tables collection.
Related Information
Syntax
Visual Basic
Members
Methods
public override void ResetDbType() [page 424] This method is not supported in Ultra
Lite.NET.
public override string ToString() [page 425] Returns the string representation of
this instance.
Properties
public override DbType DbType [page 425] Specifies the System.Data.DbType for
the parameter.
public override ParameterDirection Direction [page 426] A value indicating whether the parame
ter is input-only, output-only, bidirec
tional, or a stored procedure return
value parameter.
public override bool IsNullable [page 426] Specifies whether the parameter ac
cepts null values.
public int Offset [page 427] Specifies the offset to the ULParame
ter.Value.
public override string ParameterName [page 428] Specifies the name of the parameter.
public byte Precision [page 428] Specifies the maximum number of dig
its used to represent the ULParame
ter.Value property.
public byte Scale [page 429] Specifies the number of decimal places
to which ULParameter.Value property is
resolved.
public override int Size [page 430] Specifies the maximum size of the data
within the column.
public override string SourceColumn [page 430] Specifies the name of the source col
umn mapped to the DataSet object and
used for loading or returning the value.
public override bool SourceColumnNullMapping [page 431] Specifies whether the source column is
nullable.
public override object Value [page 433] Specifies the value of the parameter.
Remarks
A ULParameter object can be created directly using one of its many constructors, or using the
ULCommand.CreateParameter method. Because of the special treatment of the 0 and 0.0 constants and the
way overloaded methods are resolved, it is highly recommended that you explicitly cast constant values to the
object type when using the ULParameter(string,object) constructor. For example:
// C#
ULParameter p = new ULParameter( "", (object)0 );
In UltraLite.NET, parameters can only be used as IN parameters and all mapping information is ignored. Only
the ULParameter.Value property is important.
In this section:
Related Information
Initializes a ULParameter object with null (Nothing in Visual Basic) as its value.
Overload list
In this section:
ULParameter(string, ULDbType, int, ParameterDirection, bool, byte, byte, string, DataRowVersion, object)
constructor [page 420]
Initializes a ULParameter object with the specified parameter name, data type, length, direction,
nullability, numeric precision, numeric scale, source column, source version, and value.
Initializes a ULParameter object with null (Nothing in Visual Basic) as its value.
Syntax
Visual Basic
C#
public ULParameter ()
Example
The following code creates a ULParameter value of 3 and adds it to a ULCommand object named cmd.
// C#
ULParameter p = new ULParameter();
p.Value = 3;
cmd.Parameters.Add( p );
Related Information
Initializes a ULParameter object with the specified parameter name and data type.
Syntax
Visual Basic
public ULParameter (
string parameterName,
ULDbType dbType
)
Parameters
parameterName The name of the parameter. For unnamed parameters, use an empty string ("") or a null
reference (Nothing in Visual Basic) for this value. In UltraLite.NET, parameter names are not used by the
ULCommand object.
dbType One of the Sap.Data.UltraLite.ULDbType values.
Remarks
This constructor is not recommended; it is provided for compatibility with other data providers.
In UltraLite.NET parameters can only be used as IN parameters and all mapping information is ignored. Only
the ULParameter.Value property is important.
Related Information
Initializes a ULParameter object with the specified parameter name and data type.
Syntax
Visual Basic
public ULParameter (
string parameterName,
ULDbType dbType,
int size
)
Parameters
parameterName The name of the parameter. For unnamed parameters, use an empty string ("") or a null
reference (Nothing in Visual Basic) for this value. In UltraLite.NET, parameter names are not used by the
ULCommand object.
dbType One of the Sap.Data.UltraLite.ULDbType values.
size The length of the parameter.
Remarks
This constructor is not recommended; it is provided for compatibility with other data providers.
In UltraLite.NET parameters can only be used as IN parameters and all mapping information is ignored. Only
the ULParameter.Value property is important.
Related Information
Initializes a ULParameter object with the specified parameter name, data type, length, direction, nullability,
numeric precision, numeric scale, source column, source version, and value.
Syntax
Visual Basic
C#
public ULParameter (
string parameterName,
ULDbType dbType,
int size,
ParameterDirection direction,
bool isNullable,
byte precision,
byte scale,
string sourceColumn,
DataRowVersion sourceVersion,
object value
)
Parameters
parameterName The name of the parameter. For unnamed parameters, use an empty string ("") or a null
reference (Nothing in Visual Basic) for this value. In UltraLite.NET, parameter names are not used by the
ULCommand object.
dbType One of the Sap.Data.UltraLite.ULDbType values.
size The length of the parameter.
direction One of the System.Data.ParameterDirection values.
isNullable True if the value of the field can be null; otherwise, false.
precision The total number of digits to the left and right of the decimal point to which the Value property is
resolved.
scale The total number of decimal places to which the Value property is resolved.
sourceColumn The name of the source column to map.
sourceVersion One of the System.Data.DataRowVersion values.
value Pass a System.Object to produce the value of the parameter.
Exceptions
This constructor is not recommended; it is provided for compatibility with other data providers.
Related Information
Initializes a ULParameter object with the specified parameter name, data type, and length.
Syntax
Visual Basic
C#
public ULParameter (
string parameterName,
ULDbType dbType,
int size,
string sourceColumn
)
Parameters
parameterName The name of the parameter. For unnamed parameters, use an empty string ("") or a null
reference (Nothing in Visual Basic) for this value. In UltraLite.NET, parameter names are not used by the
ULCommand object.
dbType One of the Sap.Data.UltraLite.ULDbType values.
size The length of the parameter.
sourceColumn The name of the source column to map.
This constructor is not recommended; it is provided for compatibility with other data providers.
In UltraLite.NET parameters can only be used as IN parameters and all mapping information is ignored. Only
the ULParameter.Value property is important.
Related Information
Initializes a ULParameter object with the specified parameter name and value.
Syntax
Visual Basic
C#
public ULParameter (
string parameterName,
object value
)
Parameters
parameterName The name of the parameter. For unnamed parameters, use an empty string ("") or a null
reference (Nothing in Visual Basic) for this value. In UltraLite.NET, parameter names are not used by the
ULCommand object.
value Pass a System.Object class to produce the value of the parameter.
Because of the special treatment of the 0 and 0.0 constants and the way overloaded methods are resolved, it is
highly recommended that you explicitly cast constant values to the object type when using this constructor.
Example
The following code creates a ULParameter value of 0 and adds it to a ULCommand object named cmd.
// C#
cmd.Parameters.Add( new ULParameter( "", (object)0 ) );
Related Information
Syntax
Visual Basic
C#
Remarks
In UltraLite.NET, parameters can only be used as IN parameters and all mapping information is ignored. Only
the ULParameter.Value property is important.
Syntax
Visual Basic
C#
Returns
Syntax
Visual Basic
C#
Remarks
The ULParameter.ULDbType and DbType properties are linked. Therefore, setting the DbType property
changes the ULParameter.ULDbType property to a supporting Sap.Data.UltraLite.ULDbType value.
A value indicating whether the parameter is input-only, output-only, bidirectional, or a stored procedure return
value parameter.
Syntax
Visual Basic
C#
Remarks
In UltraLite.NET, parameters can only be used as IN parameters and all mapping information is ignored. Only
the ULParameter.Value property is important.
Related Information
Syntax
Visual Basic
C#
True if null values are accepted, false otherwise. The default is false. Null values are handled using the DBNull
class.
In UltraLite.NET, parameters can only be used as IN parameters and all mapping information is ignored. Only
the ULParameter.Value property is important.
Related Information
Syntax
Visual Basic
C#
Remarks
In UltraLite.NET parameters can only be used as IN parameters and all mapping information is ignored. Only
the ULParameter.Value property is important.
Related Information
Syntax
Visual Basic
C#
Remarks
A string representing the name of the parameter, or an empty string ("") for unnamed parameters. Specifying a
null reference (Nothing in Visual Basic) results in an empty string being used.
In UltraLite.NET, parameter names are not used by an ULCommand object. All parameters are treated as
positional parameters and are used by a command in the order that they were added.
Related Information
Specifies the maximum number of digits used to represent the ULParameter.Value property.
Syntax
Visual Basic
C#
The maximum number of digits used to represent the ULParameter.Value property. The default value is 0,
which indicates that the data provider sets the precision for the ULParameter.Value property.
In UltraLite.NET, parameters can only be used as IN parameters and all mapping information is ignored. Only
the ULParameter.Value property is important.
Related Information
Syntax
Visual Basic
C#
Remarks
The number of decimal places to which ULParameter.Value property is resolved. The default is 0.
In UltraLite.NET, parameters can only be used as IN parameters and all mapping information is ignored. Only
the ULParameter.Value property is important.
Related Information
Syntax
Visual Basic
C#
Remarks
The maximum size of the data within the column. The default value is inferred from the parameter value. The
Size property is used for binary and string types.
In UltraLite.NET, parameters can only be used as IN parameters and all mapping information is ignored. Only
the ULParameter.Value property is important.
Related Information
Specifies the name of the source column mapped to the DataSet object and used for loading or returning the
value.
Syntax
Visual Basic
C#
A string specifying the name of the source column mapped to the DataSet object and used for loading or
returning the value.
In UltraLite.NET, parameters can only be used as IN parameters and all mapping information is ignored. Only
the ULParameter.Value property is important.
Related Information
Syntax
Visual Basic
C#
Remarks
In UltraLite.NET, parameters can only be used as IN parameters and all mapping information is ignored. Only
the ULParameter.Value property is important.
Related Information
Syntax
Visual Basic
C#
Related Information
Syntax
Visual Basic
C#
Remarks
The ULDbType and ULParameter.DbType properties are linked. Therefore, setting the ULDbType property
changes the ULParameter.DbType property to a supporting System.Data.DbType value.
In UltraLite.NET, parameters can only be used as IN parameters and all mapping information is ignored. Only
the ULParameter.Value property is important.
Syntax
Visual Basic
C#
Remarks
The value is sent as-is to the data provider without any type conversion or mapping. When the command is
executed, the command attempts to convert the value to the required type, signaling a ULException object with
ULSQLCode.SQLE_CONVERSION_ERROR if it cannot convert the value.
Related Information
Syntax
Visual Basic
Members
Methods
public ULParameter Add [page 436] Adds a ULParameter object to the col
lection.
public override void AddRange [page 445] Adds an array of values to the end of
the ULParameterCollection.
public override void Clear() [page 447] Removes all the parameters from the
collection.
public override bool Contains [page 447] Checks whether a ULParameter object
exists in the collection.
public override void CopyTo(Array, int) [page 449] Copies ULParameter objects from the
ULParameterCollection to the specified
array.
public override IEnumerator GetEnumerator() [page 450] Returns an enumerator for the collec
tion.
public override int IndexOf [page 451] Returns the location of the ULParame
ter object in the collection.
public override void Insert(int, object) [page 453] Inserts an ULParameter object in the
collection at the specified index.
public override void Remove(object) [page 454] Removes an ULParameter object from
the collection.
public override void RemoveAt [page 455] Removes the parameter at the specified
index in the collection.
Properties
public override int Count [page 458] Returns the number of ULParameter
objects in the collection.
public override bool IsFixedSize [page 459] Indicates whether the ULParameterCol
lection object has a fixed size.
public override bool IsReadOnly [page 459] Indicates whether the ULParameterCol
lection object is read-only.
public override bool IsSynchronized [page 460] Indicates whether the ULParameterCol
lection object is synchronized.
public override object SyncRoot [page 460] Returns an object that can be used to
synchronize access to the SAParame
terCollection object.
public new ULParameter this [page 461] Returns the ULParameter object at the
specified index.
Remarks
All parameters in the collection are treated as positional parameters and are specified in the same order as the
question mark placeholders in the ULCommand.CommandText value. For example, the first parameter in the
collection corresponds to the first question mark in the SQL statement, the second parameter in the collection
corresponds to the second question mark in the SQL statement, and so on. There must be at least as many
question marks in the ULCommand.CommandText value as there are parameters in the collection. Nulls are
substituted for missing parameters.
There is no constructor for the ULParameterCollection class. You obtain a ULParameterCollection object from
the ULCommand.Parameters property.
In this section:
Related Information
Overload list
public ULParameter Add(ULParameter) [page 437] Adds a ULParameter object to the col
lection.
public override int Add(object) [page 438] Adds a ULParameter object to the col
lection.
public ULParameter Add(string, ULDbType) [page 440] Adds a new ULParameter object, cre
ated using the specified parameter
name and data type, to the collection.
public ULParameter Add(string, ULDbType, int) [page 441] Adds a new ULParameter object, cre
ated using the specified parameter
name, data type, and length, to the col
lection.
public ULParameter Add(string, ULDbType, int, string) [page Adds a new ULParameter object, cre
442] ated using the specified parameter
name, data type, length, and source
column name, to the collection.
public ULParameter Add(string, object) [page 443] Adds a new ULParameter object, cre
ated using the specified parameter
name and value, to the collection.
In this section:
Syntax
Visual Basic
C#
Returns
Exceptions
Remarks
All parameters in the collection are treated as positional parameters and must be added to the collection in the
same order as the corresponding question mark placeholders in the ULCommand.CommandText value. For
example, the first parameter in the collection corresponds to the first question mark in the SQL statement, the
second parameter in the collection corresponds to the second question mark in the SQL statement, and so on.
There must be at least as many question marks in the ULCommand.CommandText value as there are
parameters in the collection. Nulls are substituted for missing parameters.
Related Information
Syntax
Visual Basic
Parameters
Returns
Exceptions
Remarks
All parameters in the collection are treated as positional parameters and must be added to the collection in the
same order as the corresponding question mark placeholders in the ULCommand.CommandText value. For
example, the first parameter in the collection corresponds to the first question mark in the SQL statement, the
second parameter in the collection corresponds to the second question mark in the SQL statement, and so on.
There must be at least as many question marks in the ULCommand.CommandText value as there are
parameters in the collection. Nulls are substituted for missing parameters.
Related Information
Adds a new ULParameter object, created using the specified parameter name and data type, to the collection.
Syntax
Visual Basic
C#
Parameters
parameterName The name of the parameter. For unnamed parameters, use an empty string ("") or a null
reference (Nothing in Visual Basic) for this value. In UltraLite.NET, parameter names are not used by the
ULCommand object.
ulDbType One of the Sap.Data.UltraLite.ULDbType values.
Returns
Remarks
All parameters in the collection are treated as positional parameters and must be added to the collection in the
same order as the corresponding question mark placeholders in the ULCommand.CommandText value. For
example, the first parameter in the collection corresponds to the first question mark in the SQL statement, the
second parameter in the collection corresponds to the second question mark in the SQL statement, and so on.
There must be at least as many question marks in the ULCommand.CommandText value as there are
parameters in the collection. Nulls are substituted for missing parameters.
Adds a new ULParameter object, created using the specified parameter name, data type, and length, to the
collection.
Syntax
Visual Basic
C#
Parameters
parameterName The name of the parameter. For unnamed parameters, use an empty string ("") or a null
reference (Nothing in Visual Basic) for this value. In UltraLite.NET, parameter names are not used by the
ULCommand object.
ulDbType One of the Sap.Data.UltraLite.ULDbType values.
size The length of the parameter.
Returns
All parameters in the collection are treated as positional parameters and must be added to the collection in the
same order as the corresponding question mark placeholders in the ULCommand.CommandText value. For
example, the first parameter in the collection corresponds to the first question mark in the SQL statement, the
second parameter in the collection corresponds to the second question mark in the SQL statement, and so on.
There must be at least as many question marks in the ULCommand.CommandText value as there are
parameters in the collection. Nulls are substituted for missing parameters.
Related Information
Adds a new ULParameter object, created using the specified parameter name, data type, length, and source
column name, to the collection.
Syntax
Visual Basic
C#
parameterName The name of the parameter. For unnamed parameters, use an empty string ("") or a null
reference (Nothing in Visual Basic) for this value. In UltraLite.NET, parameter names are not used by the
ULCommand object.
ulDbType One of the Sap.Data.UltraLite.ULDbType values.
size The length of the parameter.
sourceColumn The name of the source column to map.
Returns
Remarks
All parameters in the collection are treated as positional parameters and must be added to the collection in the
same order as the corresponding question mark placeholders in the ULCommand.CommandText value. For
example, the first parameter in the collection corresponds to the first question mark in the SQL statement, the
second parameter in the collection corresponds to the second question mark in the SQL statement, and so on.
There must be at least as many question marks in the ULCommand.CommandText value as there are
parameters in the collection. Nulls are substituted for missing parameters.
Related Information
Adds a new ULParameter object, created using the specified parameter name and value, to the collection.
Syntax
Visual Basic
C#
Parameters
parameterName The name of the parameter. For unnamed parameters, use an empty string ("") or a null
reference (Nothing in Visual Basic) for this value. In UltraLite.NET, parameter names are not used by the
ULCommand object.
value A System.Object that is to be the value of the parameter.
Returns
Remarks
All parameters in the collection are treated as positional parameters and must be added to the collection in the
same order as the corresponding question mark placeholders in the ULCommand.CommandText value. For
example, the first parameter in the collection corresponds to the first question mark in the SQL statement, the
second parameter in the collection corresponds to the second question mark in the SQL statement, and so on.
There must be at least as many question marks in the ULCommand.CommandText value as there are
parameters in the collection. Nulls are substituted for missing parameters.
Because of the special treatment of the 0 and 0.0 constants and the way overloaded methods are resolved, it is
highly recommended that you explicitly cast constant values to the object type when using this method.
Example
The following code adds a ULParameter value of 0 to a ULCommand object named cmd.
// C#
cmd.Parameters.Add( "", (object)0 );
Overload list
public override void AddRange(Array) [page 445] Adds an array of values to the end of
the ULParameterCollection.
public void AddRange(ULParameter[]) [page 446] Adds an array of values to the end of
the ULParameterCollection.
In this section:
Syntax
Visual Basic
C#
Related Information
Syntax
Visual Basic
C#
Parameters
Remarks
Related Information
Syntax
Visual Basic
C#
Overload list
public override bool Contains(object) [page 447] Checks whether a ULParameter object
exists in the collection.
public override bool Contains(string) [page 448] Checks whether a ULParameter object
with the specified name exists in the
collection.
In this section:
Syntax
Visual Basic
Parameters
Returns
Related Information
Checks whether a ULParameter object with the specified name exists in the collection.
Syntax
Visual Basic
C#
Parameters
Related Information
Syntax
Visual Basic
C#
Parameters
Related Information
Syntax
Visual Basic
C#
Returns
Overload list
In this section:
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
Overload list
public override int IndexOf(object) [page 452] Returns the location of the ULParame
ter object in the collection.
public override int IndexOf(string) [page 453] Returns the location of the ULParame
ter object with the specified name in
the collection.
In this section:
Syntax
Visual Basic
C#
Parameters
Returns
The zero-based index of the ULParameter object in the collection or -1 if the parameter is not found.
Exceptions
Related Information
Returns the location of the ULParameter object with the specified name in the collection.
Syntax
Visual Basic
C#
Parameters
Returns
The zero-based index of the ULParameter object in the collection or -1 if the parameter is not found.
Related Information
Syntax
Visual Basic
Parameters
index The zero-based index where the parameter is to be inserted within the collection.
value The ULParameter object to insert.
Exceptions
Related Information
Syntax
Visual Basic
C#
Parameters
ArgumentNullException You cannot set a parameter using a null reference (Nothing in Visual Basic).
InvalidCastException The value specified must be a ULParameter object.
ArgumentException The collection does not contain the specified parameter.
Related Information
Overload list
public override void RemoveAt(int) [page 455] Removes the parameter at the specified
index in the collection.
public override void RemoveAt(string) [page 456] Removes the parameter with the speci
fied name from the collection.
In this section:
Syntax
Visual Basic
Parameters
index The zero-based index of the parameter to remove. The value must be in the range
[0,ULParameterCollection.Count-1]. The first parameter in the collection has an index value of zero.
Exceptions
Related Information
Removes the parameter with the specified name from the collection.
Syntax
Visual Basic
C#
Parameters
Related Information
Overload list
In this section:
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
Remarks
Syntax
Visual Basic
C#
Remarks
Syntax
Visual Basic
C#
Remarks
Syntax
Visual Basic
C#
Remarks
Returns an object that can be used to synchronize access to the SAParameterCollection object.
Syntax
Visual Basic
C#
Remarks
Overload list
public new ULParameter this[int index] [page 461] Returns the ULParameter object at the
specified index.
public new ULParameter this[string parameterName] [page 462] Returns the ULParameter object with
the specified name.
In this section:
Syntax
Visual Basic
C#
Returns
Related Information
Syntax
Visual Basic
C#
Returns
Remarks
Related Information
Syntax
Visual Basic
C#
Members
public unsafe void AppendBytes(int, byte[], int, int) [page Appends the specified subset of the
469] specified array of System.Bytes to the
new value for the specified ULDb
Type.LongBinary column.
public unsafe void AppendChars(int, char[], int, int) [page Appends the specified subset of the
471] specified array of System.Chars to the
new value for the specified ULDb
Type.LongVarchar column.
public void SetBoolean(int, bool) [page 473] Sets the value for the specified column
using a System.Boolean.
public void SetByte(int, byte) [page 474] Sets the value for the specified column
using a System.Byte (unsigned 8-bit in
teger).
public unsafe void SetBytes(int, byte[]) [page 475] Sets the value for the specified column
using an array of System.Bytes.
public unsafe void SetDateTime(int, DateTime) [page Sets the value for the specified column
476] using a System.DateTime.
public void SetDecimal(int, decimal) [page 478] Sets the value for the specified column
using a System.Decimal.
public void SetDouble(int, double) [page 479] Sets the value for the specified column
using a System.Double.
public void SetFloat(int, float) [page 480] Sets the value for the specified column
using a System.Single.
public unsafe void SetGuid(int, Guid) [page 481] Sets the value for the specified column
using a System.Guid.
public void SetInt16(int, short) [page 483] Sets the value for the specified column
using a System.Int16.
public void SetInt32(int, int) [page 484] Sets the value for the specified column
using a System.Int32.
public void SetInt64(int, long) [page 485] Sets the value for the specified column
using an Int64.
public unsafe void SetString(int, string) [page 486] Sets the value for the specified column
using a System.String.
public unsafe void SetTimeSpan(int, TimeSpan) [page Sets the value for the specified column
487] using a System.TimeSpan.
public void SetToDefault(int) [page 488] Sets the value for the specified column
to its default value.
public void SetUInt16(int, ushort) [page 489] Sets the value for the specified column
using a System.UInt16.
public void SetUInt32(int, uint) [page 490] Sets the value for the specified column
using a System.UInt32.
public void SetUInt64(int, ulong) [page 492] Sets the value for the specified column
using a System.UInt64.
public void Update() [page 493] Updates the current row with the cur
rent column values (specified using the
set methods).
public void UpdateBegin() [page 493] Prepares to update the current row.
public override int Depth [page 347] Returns the depth of nesting for the
current row.
public override int FieldCount [page 347] Returns the number of columns in the
cursor.
public override unsafe bool GetBoolean(int) [page 310] Returns the value for the specified col
umn as a System.Boolean.
public override unsafe byte GetByte(int) [page 311] Returns the value for the specified col
umn as an unsigned 8-bit value (Sys
tem.Byte).
public unsafe byte[] GetBytes(int) [page 312] UL Ext: Returns the value for the speci
fied column as an array of Sys
tem.Bytes values.
public override unsafe long GetBytes(int, long, byte[], int, int) [page Copies a subset of the value for the
313] specified ULDbType.LongBinary col
umn, beginning at the specified offset,
to the specified offset of the destination
System.Byte array.
public override char GetChar(int) [page 315] This method is not supported in Ultra
Lite.NET.
public override unsafe long GetChars(int, long, char[], int, int) Copies a subset of the value for the
[page 316] specified ULDbType.LongVarchar col
umn, beginning at the specified offset,
to the specified offset of the destination
System.Char array.
public override string GetDataTypeName(int) [page 317] Returns the name of the specified col
umn's provider data type.
public override unsafe DateTime GetDateTime(int) [page 318] Returns the value for the specified col
umn as a System.DateTime type with
millisecond accuracy.
public override decimal GetDecimal(int) [page 319] Returns the value for the specified col
umn as a System.Decimal type.
public override unsafe double GetDouble(int) [page 320] Returns the value for the specified col
umn as a System.Double type.
public override Type GetFieldType(int) [page 321] Returns the System.Type value most
appropriate for the specified column.
public override unsafe float GetFloat(int) [page 322] Returns the value for the specified col
umn as a System.Single type.
public override unsafe Guid GetGuid(int) [page 323] Returns the value for the specified col
umn as a UUID (System.Guid) type.
public override unsafe short GetInt16(int) [page 324] Returns the value for the specified col
umn as a System.Int16 type.
public override unsafe int GetInt32(int) [page 325] Returns the value for the specified col
umn as a System.Int32 type.
public override unsafe long GetInt64(int) [page 326] Returns the value for the specified col
umn as a System.Int64 type.
public override string GetName(int) [page 327] Returns the name of the specified col
umn.
public override unsafe int GetOrdinal(string) [page 328] Returns the column ID of the named
column.
public unsafe int GetRowCount(int) [page 329] UL Ext: Returns the number of rows in
the cursor, within threshold.
public override unsafe String GetString(int) [page 332] Returns the value for the specified col
umn as a System.String type.
public unsafe TimeSpan GetTimeSpan(int) [page 333] Returns the value for the specified col
umn as a System.TimeSpan type with
millisecond accuracy.
public unsafe ushort GetUInt16(int) [page 334] Returns the value for the specified col
umn as a System.UInt16 type.
public unsafe uint GetUInt32(int) [page 335] Returns the value for the specified col
umn as a System.UInt32 type.
public unsafe ulong GetUInt64(int) [page 336] Returns the value for the specified col
umn as a System.UInt64 type.
public override object GetValue(int) [page 337] Returns the value of the specified col
umn in its native format.
public override int GetValues(object[]) [page 338] Returns all the column values for the
current row.
public override unsafe bool HasRows [page 348] Checks whether the ULDataReader ob
ject has one or more rows.
public unsafe bool IsBOF [page 348] UL Ext: Checks whether the current row
position is before the first row.
public override bool IsClosed [page 349] Checks whether the cursor is currently
open.
public override unsafe bool IsDBNull(int) [page 339] Checks whether the value from the
specified column is NULL.
public unsafe bool IsEOF [page 349] UL Ext: Checks whether the current row
position is after the last row.
public void MoveAfterLast() [page 340] UL Ext: Positions the cursor to after the
last row of the cursor.
public void MoveBeforeFirst() [page 340] UL Ext: Positions the cursor to before
the first row of the cursor.
public unsafe bool MoveFirst() [page 341] UL Ext: Positions the cursor to the first
row of the cursor.
public unsafe bool MoveLast() [page 341] UL Ext: Positions the cursor to the last
row of the cursor.
public unsafe bool MoveNext() [page 342] UL Ext: Positions the cursor to the next
row or after the last row if the cursor
was already on the last row.
public unsafe bool MovePrevious() [page 343] UL Ext: Positions the cursor to the pre
vious row or before the first row.
public unsafe bool MoveRelative(int) [page 343] UL Ext: Positions the cursor relative to
the current row.
public override bool NextResult() [page 344] Advances the ULDataReader object to
the next result when reading the results
of batch SQL statements.
public override bool Read() [page 345] Positions the cursor to the next row, or
after the last row if the cursor was al
ready on the last row.
public override int RecordsAffected [page 350] Returns the number of rows changed,
inserted, or deleted by execution of the
SQL statement.
public int RowCount [page 350] UL Ext: Returns the number of rows in
the cursor.
public ULCursorSchema Schema [page 351] UL Ext: Holds the schema of this cursor.
public override object this[int colID] [page 352] Returns the value of the specified col
umn in its native format.
public override object this[string name] [page 353] Returns the value of the specified
named column in its native format.
Remarks
There is no constructor for this class. Result sets are created using the ULCommand.ExecuteResultSet
method.
// C#
ULCommand cmd = new ULCommand(
"SELECT emp_id FROM employee", conn
);
ULResultSet resultSet = cmd.ExecuteResultSet();
A ULResultSet object represents an editable result set on which you can perform positioned updates and
deletes. For fully editable result sets, use the ULCommand.ExecuteTable method or the ULDataAdapter class.
In this section:
Related Information
Appends the specified subset of the specified array of System.Bytes to the new value for the specified
ULDbType.LongBinary column.
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
val The value to append to the current new value for the column.
srcOffset The start position in the source array.
Exceptions
Remarks
The bytes at position srcOffset (starting from 0) through srcOffset +count -1 of the array val are appended to
the value for the specified column.
When inserting, ULTable.InsertBegin initializes the new value to the column's default value. The data in the row
is not actually changed until you execute an ULTable.Insert, and changes are not made permanent until
committed.
When updating, the first append on a column clears the current value prior to appending the new value.
If any of the following are true, a ULException with code ULSQLCode.SQLE_INVALID_PARAMETER is thrown
and the destination is not modified:
● val is null.
● srcOffset is negative.
● count is negative.
● srcOffset +count is greater than the val length.
For other errors, a ULException with the appropriate error code is thrown.
Related Information
Appends the specified subset of the specified array of System.Chars to the new value for the specified
ULDbType.LongVarchar column.
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
val The value to append to the current new value for the column.
srcOffset The start position in the source array.
count The number of bytes to be copied.
Exceptions
Remarks
The characters at position srcOffset (starting from 0) through srcOffset +count -1 of the array val are appended
to the value for the specified column. When inserting, ULTable.InsertBegin initializes the new value to the
column's default value. The data in the row is not actually changed until you execute an ULTable.Insert, and
changes are not made permanent until committed.
When updating, the first append on a column clears the current value prior to appending the new value.
● val is null.
● srcOffset is negative.
● count is negative.
● srcOffset +count is greater than val length.
For other errors, a ULException with the appropriate error code is thrown.
Related Information
Syntax
Visual Basic
C#
Exceptions
Related Information
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
val The new value for the column.
Exceptions
Remarks
The data in the row is not actually changed until you execute a ULTable.Insert or Update method, and changes
are not made permanent until committed.
Related Information
Sets the value for the specified column using a System.Byte (unsigned 8-bit integer).
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
val The new value for the column.
Exceptions
Remarks
The data in the row is not actually changed until you execute a ULTable.Insert or Update method, and changes
are not made permanent until committed.
Sets the value for the specified column using an array of System.Bytes.
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
val The new value for the column.
Exceptions
Only suitable for columns of type ULDbType.Binary or ULDbType.LongBinary, or for columns of type
ULDbType.UniqueIdentifier when the value is of length 16. The data in the row is not actually changed until you
execute a ULTable.Insert or Update method, and changes are not made permanent until committed.
Related Information
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
val The new value for the column.
Remarks
The set value is accurate to the millisecond. The data in the row is not actually changed until you execute a
ULTable.Insert or Update method, and changes are not made permanent until committed.
Related Information
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Remarks
The data is not actually changed until you execute an ULTable.Insert or Update, and changes are not made
permanent until committed.
Related Information
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Exceptions
Remarks
The data in the row is not actually changed until you execute a ULTable.Insert or Update method, and changes
are not made permanent until committed.
Related Information
Syntax
Visual Basic
C#
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
val The new value for the column.
Exceptions
Remarks
The data in the row is not actually changed until you execute a ULTable.Insert or Update method, and changes
are not made permanent until committed.
Related Information
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
val The new value for the column.
Exceptions
Remarks
The data in the row is not actually changed until you execute a ULTable.Insert or Update method, and changes
are not made permanent until committed.
Related Information
Syntax
Visual Basic
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
val The new value for the column.
Exceptions
Remarks
The data in the row is not actually changed until you execute a ULTable.Insert or Update method, and changes
are not made permanent until committed. Only valid for columns of type ULDbType.UniqueIdentifier or for
columns of type ULDbType.Binary with a length of 16.
Related Information
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
val The new value for the column.
Exceptions
Remarks
The data in the row is not actually changed until you execute a ULTable.Insert or Update method, and changes
are not made permanent until committed.
Related Information
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
val The new value for the column.
Exceptions
Remarks
The data in the row is not actually changed until you execute a ULTable.Insert or Update method, and changes
are not made permanent until committed.
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
val The new value for the column.
Exceptions
The data in the row is not actually changed until you execute a ULTable.Insert or Update method, and changes
are not made permanent until committed.
Related Information
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
val The new value for the column.
Remarks
The data in the row is not actually changed until you execute a ULTable.Insert or Update method, and changes
are not made permanent until committed.
Related Information
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Exceptions
Remarks
The set value is accurate to the millisecond and is normalized to a nonnegative value between 0 and 24 hours.
The data in the row is not actually changed until you execute a ULTable.Insert or Update method, and changes
are not made permanent until committed.
Related Information
Sets the value for the specified column to its default value.
Syntax
Visual Basic
C#
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
Exceptions
Remarks
The data in the row is not actually changed until you execute a ULTable.Insert or Update method, and changes
are not made permanent until committed.
Related Information
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
val The new value for the column.
Exceptions
Remarks
The data in the row is not actually changed until you execute a ULTable.Insert or Update method, and changes
are not made permanent until committed.
Related Information
Syntax
Visual Basic
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
val The new value for the column.
Exceptions
Remarks
The data in the row is not actually changed until you execute a ULTable.Insert or Update method, and changes
are not made permanent until committed.
Related Information
Syntax
Visual Basic
C#
Parameters
colID The ID number of the column. The value must be in the range [0,ULDataReader.FieldCount-1]. The
first column in the cursor has an ID value of zero.
val The new value for the column.
Exceptions
Remarks
The data in the row is not actually changed until you execute a ULTable.Insert or Update method, and changes
are not made permanent until committed.
Related Information
Updates the current row with the current column values (specified using the set methods).
Syntax
Visual Basic
C#
Exceptions
Related Information
Syntax
Visual Basic
C#
Remarks
Column values are modified by calling the appropriate setType or AppendType method(s). The first append on
a column clears the current column value prior to appending the new value.
The data in the row is not actually changed until you call the Update method, and changes are not made
permanent until committed.
Modifying columns in the index used to open the table affects active searches in unpredictable ways. Columns
in the primary key of the table can not be updated.
Related Information
Syntax
Visual Basic
C#
Members
public override string Name [page 496] Returns the name of the cursor.
public short ColumnCount [page 266] Returns the number of columns in the
cursor.
public unsafe short GetColumnID(string) [page 258] Returns the column ID of the named
column.
public string GetColumnName(int) [page 259] Returns the name of the column identi
fied by the specified column ID.
public unsafe int GetColumnPrecision(int) [page 260] Returns the precision of the column
identified by the specified column ID if
the column is a numeric column (the
NUMERIC SQL type).
public unsafe int GetColumnScale(int) [page 261] Returns the scale of the column identi
fied by the specified column ID if the
column is a numeric column (the NU
MERIC SQL type).
public unsafe int GetColumnSize(int) [page 262] Returns the size of the column identi
fied by the specified column ID if the
column is a sized column (the BINARY
or CHAR SQL types).
public string GetColumnSQLName(int) [page 263] Returns the name of the column identi
fied by the specified column ID.
public unsafe ULDbType GetColumnULDbType(int) [page 264] Returns the UltraLite.NET data type of
the column identified by the specified
column ID.
public bool IsOpen [page 266] Checks whether the cursor schema is
currently open.
Remarks
There is no constructor for this class. A ULResultSetSchema object is attached to a result set as its
ULDataReader.Schema property.
A result set schema is only valid while the data reader is open.
In this section:
Related Information
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
Remarks
Syntax
Visual Basic
C#
Members
Properties
public bool Abort [page 498] Gets or sets a value that indicates
whether the bulk-copy operation should
be aborted.
public long RowsCopied [page 499] Returns the number of rows copied dur
ing the current bulk-copy operation.
Remarks
The ULRowsCopiedEventArgs class is not available in the .NET Compact Framework 2.0.
In this section:
Syntax
Visual Basic
C#
Parameters
rowsCopied A 64-bit integer value that indicates the number of rows copied during the current bulk-copy
operation.
Remarks
The ULRowsCopiedEventArgs class is not available in the .NET Compact Framework 2.0.
Gets or sets a value that indicates whether the bulk-copy operation should be aborted.
Syntax
Visual Basic
C#
The ULRowsCopiedEventArgs class is not available in the .NET Compact Framework 2.0.
Returns the number of rows copied during the current bulk-copy operation.
Syntax
Visual Basic
C#
Remarks
The ULRowsCopiedEventArgs class is not available in the .NET Compact Framework 2.0.
Syntax
Visual Basic
C#
Members
Properties
public new ULCommand Command [page 501] Returns the ULCommand object exe
cuted when the DbDataAdapter.Update
method is called.
public new int RecordsAffected [page 502] Returns the number of rows changed,
inserted, or deleted by the execution of
the SQL statement.
In this section:
Related Information
Syntax
Visual Basic
public ULRowUpdatedEventArgs (
DataRow row,
IDbCommand command,
StatementType statementType,
DataTableMapping tableMapping
)
Parameters
Returns the ULCommand object executed when the DbDataAdapter.Update method is called.
Syntax
Visual Basic
C#
Remarks
Related Information
Returns the number of rows changed, inserted, or deleted by the execution of the SQL statement.
Syntax
Visual Basic
C#
Remarks
The number of rows changed, inserted, or deleted; 0 if no rows were affected or the statement failed; and -1 for
SELECT statements.
Syntax
Visual Basic
C#
Members
Constructors
Properties
public new ULCommand Command [page 504] Specifies the ULCommand object to ex
ecute when performing the DbDataA
dapter.Update method.
In this section:
Related Information
Syntax
Visual Basic
C#
public ULRowUpdatingEventArgs (
DataRow row,
IDbCommand command,
StatementType statementType,
DataTableMapping tableMapping
Parameters
Specifies the ULCommand object to execute when performing the DbDataAdapter.Update method.
Syntax
Visual Basic
C#
Remarks
Related Information
Syntax
Visual Basic
C#
Members
public void ServerSyncInvoked(string) [page 505] Invoked when the MobiLink Listener for
server-initiated synchronizations calls
the application to perform synchroniza
tion.
In this section:
Invoked when the MobiLink Listener for server-initiated synchronizations calls the application to perform
synchronization.
Syntax
Visual Basic
C#
Remarks
This method is invoked by a separate thread. To avoid multi-threading issues, it should post an event to the UI.
If you are using multi-threading, use a separate connection and use the lock keyword to access any objects
shared with the rest of the application.
Example
Imports Sap.Data.UltraLite
Public Sub ServerSyncAction( _ ByVal sender As Object, ByVal e As EventArgs _ ) ' Do Server sync
conn.Synchronize() End Sub End Class
The following C# code demonstrates how to receive a server synchronization request and perform a
synchronization in the UI thread.
using Sap.Data.UltraLite;
public class Form1 : System.Windows.Forms.Form, ULServerSyncListener
{
private System.Windows.Forms.MainMenu mainMenu1;
private ULConnection conn;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after
// InitializeComponent call
//
ULConnection.DatabaseManager.SetServerSyncListener(
Syntax
C#
Members
public long CurrentScript [page 508] The index of the scripts executed so far.
public long ScriptCount [page 508] Returns the number of scripts being
executed.
public ULSqlProgressState State [page 509] Returns the current progress state.
In this section:
Syntax
Visual Basic
C#
Remarks
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
Remarks
One of the ULSqlProgressState values specifying the current SQL passthrough callback state.
Related Information
UL Ext: Represents synchronization parameters that define how to synchronize an UltraLite database.
Syntax
Visual Basic
C#
Methods
public void CopyFrom(ULSyncParms) [page 512] Copies the properties of the specified
ULSyncParms object to this ULSync
Parms object.
public override string ToString() [page 513] Returns the string representation of
this instance.
Properties
public string[] AuthenticationParms [page 514] Specifies parameters for a custom user
authentication script (MobiLink authen
ticate_parameters connection event).
public string NewPassword [page 517] Specifies a new MobiLink password for
the user specified with UserName.
public string Password [page 518] The MobiLink password for the user
specified by UserName.
public bool PingOnly [page 518] Specifies whether the client should only
ping the MobiLink server instead of per
forming a real synchronization.
public bool SendDownloadAck [page 521] Specifies whether the client should
send a download acknowledgement to
the MobiLink server during synchroni
zation.
public string UserName [page 524] The user name that uniquely identifies
the MobiLink client to the MobiLink
server.
Remarks
There is no constructor for this class. Each connection has its own ULSyncParms instance, attached as its
ULConnection.SyncParms property.
In this section:
Related Information
Copies the properties of the specified ULSyncParms object to this ULSyncParms object.
Syntax
Visual Basic
C#
Related Information
Syntax
Visual Basic
C#
Returns
Syntax
Visual Basic
C#
Remarks
Use this property to specify several additional synchronization parameters that cannot be readily specified
using any other predefined parameters.
Example
Specifies parameters for a custom user authentication script (MobiLink authenticate_parameters connection
event).
Syntax
Visual Basic
C#
Returns
An array of strings, each containing an authentication parameter (null array entries result in a synchronization
error). The default is a null reference (Nothing in Visual Basic), meaning no authentication parameters.
Only the first 255 strings are used and each string should be no longer than the MobiLink server's limit for
authentication parameters (currently 4000 UTF8 bytes).
Syntax
Visual Basic
C#
Returns
True to disable uploads when synchronizing, false to enable uploads. The default is false.
Remarks
Related Information
Syntax
Visual Basic
C#
Returns
Set to true to enable and save partial downloads while synchronizing; otherwise, set to false to disable partial
downloads and roll back downloads if any errors occur. The default is false.
Remarks
Using the ULSyncProgressListener object, UltraLite.NET can resume partial downloads that fail because of
communication errors or user aborts. UltraLite.NET processes the download as it is received. If a download is
interrupted, then the partial download transaction remains in the database and can be resumed during the
next synchronization.
If the PartialDownloadRetained property is set, then you can resume a download. To do this, call the
ULConnection.Synchronize method with the ULConnection.ULSyncParms.ResumePartialDownload property
set to true. Keep the KeepPartialDownload property set to true in case another communications error occurs.
No upload is done if a download is skipped.
The download you receive during a resumed download is as old as when the download originally began. If you
need the most recent data, then you can do another download immediately after the resumed download
completes.
When resuming a download, many of the ULSyncParms properties are not relevant. For example, the
Publications property is not used. You receive the publications that you requested on the initial download. The
only properties that must be set are ResumePartialDownload and UserName. The KeepPartialDownload
property can be set if desired and functions as normal.
If you have a partial download that is no longer needed, call the ULConnection.RollbackPartialDownload
method to roll back the failed download transaction. If you attempt to synchronize again and do not specify the
ResumePartialDownload property, then the partial download is rolled back before the next synchronization
begins.
Specifies a new MobiLink password for the user specified with UserName.
Syntax
Visual Basic
C#
Returns
A string specifying a new MobiLink password. The default is a null reference (Nothing in Visual Basic), meaning
the password is not changed.
Remarks
Related Information
Syntax
Visual Basic
C#
Returns
A string specifying the MobiLink password. The default is a null reference (Nothing in Visual Basic), meaning no
password is specified.
Remarks
The MobiLink user name and password are separate from any database user ID and password, and serve to
identify and authenticate the application to the MobiLink server.
Related Information
Specifies whether the client should only ping the MobiLink server instead of performing a real synchronization.
Syntax
Visual Basic
C#
True to specify that the client should only ping the MobiLink server, false to specify the client should perform a
real synchronization. The default is false.
Remarks
Related Information
Syntax
Visual Basic
C#
Returns
A string containing a list of publication names, separated by comma (,); or the special value
ULConnection.SYNC_ALL_PUBS, or the special value ULConnection.SYNC_ALL_DB. The default is
ULConnection.SYNC_ALL_DB.
Syntax
Visual Basic
C#
Returns
True to resume a previous partial download, false to discard a previous partial download. The default is false.
Remarks
Related Information
Specifies whether the client should send a download acknowledgement to the MobiLink server during
synchronization.
Syntax
Visual Basic
C#
Returns
Set to true to specify that the client should send a download acknowledgement to the MobiLink server. Set to
false to specify that no download acknowledgement is sent. The default is false.
Remarks
The download acknowledgement is sent after the download has been fully applied and committed at the
remote (a positive acknowledgement) or after the download fails (a negative acknowledgement).
If the client sends a download acknowledgement, the MobiLink server database worker thread must wait for
the client to apply and commit the download. If the client does not sent a download acknowledgement, the
MobiLink server is freed up sooner for its next synchronization.
Syntax
Visual Basic
C#
One of the ULStreamType values specifying the type of synchronization stream to use. The default value is
ULStreamType.TCPIP.
Remarks
Most synchronization streams require parameters to identify the MobiLink server address and control other
behavior. These parameters are supplied by the ULSyncParms.StreamParms property.
If the stream type is set to a value that is invalid for the platform, the stream type is set to ULStreamType.TCPIP.
Related Information
Syntax
Visual Basic
C#
Returns
A string, in the form of a semicolon-separated list of keyword=value pairs, specifying the parameters for the
stream. The default is a null reference (Nothing in Visual Basic).
StreamParms is a string containing all the parameters used for synchronization streams. Parameters are
specified as a semicolon-separated list of name=value pairs ("param1=value1;param2=value2").
Related Information
Syntax
Visual Basic
C#
Returns
Remarks
Related Information
The user name that uniquely identifies the MobiLink client to the MobiLink server.
Syntax
Visual Basic
C#
Returns
A string specifying the user name. This parameter has no default value, and must be explicitly set.
Remarks
The MobiLink server uses this value to determine the download content, to record the synchronization state,
and to recover from interruptions during synchronization. This user name and password are separate from any
database user ID and password, and serve to identify and authenticate the application to the MobiLink server.
Related Information
Syntax
Visual Basic
C#
Returns
A string specifying the version of the synchronization script to use. This parameter has no default value, and
must be explicitly set.
Remarks
Each synchronization script in the consolidated database is marked with a version string. For example, there
can be two different download_cursor scripts, with each one identified by a different version string. The version
string allows an UltraLite application to choose from a set of synchronization scripts.
Syntax
Visual Basic
C#
Members
public const int FLAG_LAST_UPLOAD_RECEIVED A flag indicating whether the server re
ceived the last upload.
Properties
public int CurrentDownloadRowCount [page Returns the number of rows that have
528] been downloaded so far.
public int IgnoredDeletes [page 529] Returns the number of rows received so
far that have already been deleted.
public int IgnoredUpdates [page 530] Returns the number of rows received so
far that have already been updated.
public bool IsFinalSyncProgress [page 530] Returns true if this is final synchroniza
tion progress message.
public long ReceivedBytes [page 531] Returns the number of bytes received
so far.
public int ReceivedDeletes [page 532] Returns the number of deleted rows re
ceived so far.
public int ReceivedInserts [page 532] Returns the number of inserted rows
received so far.
public int ReceivedUpdates [page 533] Returns the number of updated rows
received so far.
public long SentBytes [page 533] Returns the number of bytes sent so
far.
public int SentDeletes [page 534] Returns the number of deleted rows
sent so far.
public int SentInserts [page 535] Returns the number of inserted rows
sent so far.
public int SentUpdates [page 535] Returns the number of updated rows
sent so far.
public int SyncTableCount [page 536] Returns the number of tables being
synchronized.
public int SyncTableIndex [page 537] Returns the index of the table currently
being synchronized in the range from 1
to the total number of tables involved
with the synchronization.
public int TableID [page 538] Returns the database index of the table
currently being synchronized.
public string TableName [page 538] Returns the name of the current table
being uploaded or downloaded.
public int TotalDownloadRowCount [page 539] Returns the total number of rows to be
received in the download.
public int TruncateDeletes [page 539] Returns the number of rows that have
been deleted by a truncate operation.
In this section:
Related Information
Syntax
Visual Basic
C#
Returns
This number includes duplicate rows that aren't included in ReceivedInserts, ReceivedUpdates, or
ReceivedDeletes.
Related Information
Returns the current synchronization flags indicating additional information relating to the current state.
Syntax
Visual Basic
C#
Returns
Returns the number of rows received so far that have already been deleted.
Syntax
Visual Basic
C#
The number of rows received so far that have already been deleted.
Related Information
Returns the number of rows received so far that have already been updated.
Syntax
Visual Basic
C#
Returns
The number of rows received so far that have already been updated.
Related Information
Syntax
Visual Basic
Returns
Syntax
Visual Basic
C#
Returns
Remarks
Related Information
Syntax
Visual Basic
C#
Returns
Related Information
Syntax
Visual Basic
C#
Returns
Syntax
Visual Basic
C#
Returns
Related Information
Syntax
Visual Basic
C#
Remarks
Related Information
Syntax
Visual Basic
C#
Returns
Related Information
Syntax
Visual Basic
C#
Returns
Related Information
Syntax
Visual Basic
C#
Returns
Syntax
Visual Basic
C#
Returns
Related Information
Syntax
Visual Basic
C#
The number of tables being synchronized. For each table there is a sending and receiving phase, so this
number may be more than the number of tables being synchronized.
Related Information
Returns the index of the table currently being synchronized in the range from 1 to the total number of tables
involved with the synchronization.
Syntax
Visual Basic
C#
Returns
The index of the table currently being synchronized in the range from 1 to the SyncTableCount property value.
Related Information
Syntax
Visual Basic
C#
Returns
The database index, in the range from 1 to the ULDatabaseSchema.TableCount property value.
Related Information
Syntax
Visual Basic
C#
Returns
Syntax
Visual Basic
C#
Returns
Remarks
This number includes duplicate rows that aren't included in ReceivedInserts, ReceivedUpdates, or
ReceivedDeletes. This value isn't set until the synchronization enters the STATE_RECEIVING_TABLE state for
the first table.
Related Information
Returns the number of rows that have been deleted by a truncate operation.
Syntax
Visual Basic
C#
Related Information
Syntax
Visual Basic
C#
Members
In this section:
Related Information
Syntax
Visual Basic
C#
Parameters
Returns
This method should return true to cancel synchronization or return false to continue.
Remarks
This method should return true to cancel synchronization or return false to continue.
Related Information
Syntax
Visual Basic
C#
Members
public ULAuthStatusCode AuthStatus [page 543] Returns the authorization status code
for the last synchronization attempt.
public long AuthValue [page 544] Returns the return value from custom
user authentication synchronization
scripts.
public bool IgnoredRows [page 544] Checks whether any uploaded rows
were ignored during the last synchroni
zation.
public bool PartialDownloadRetained [page 545] Checks whether a partial download was
retained during the last synchroniza
tion.
public ULStreamErrorCode StreamErrorCode [page 546] Returns the error reported by the
stream itself.
public int StreamErrorSystem [page 547] Returns the stream error system-spe
cific code.
public DateTime Timestamp [page 547] Returns the timestamp of the last syn
chronization.
public bool UploadOK [page 548] Checks whether the last upload syn
chronization was successful.
There is no constructor for this class. Each connection has its own ULSyncResult instance, attached as its
ULConnection.SyncResult property. A ULSyncResult instance is only valid while that connection is open.
In this section:
Related Information
Returns the authorization status code for the last synchronization attempt.
Syntax
Visual Basic
Remarks
One of the ULAuthStatusCode values denoting the authorization status for the last synchronization attempt.
Related Information
Returns the return value from custom user authentication synchronization scripts.
Syntax
Visual Basic
C#
Remarks
Checks whether any uploaded rows were ignored during the last synchronization.
Syntax
Visual Basic
Remarks
True if any uploaded rows were ignored during the last synchronization, false if no rows were ignored.
Related Information
Checks whether a partial download was retained during the last synchronization.
Syntax
Visual Basic
C#
Remarks
True if a download was interrupted and the partial download was retained, false if the download was not
interrupted or if the partial download was rolled back.
Related Information
Syntax
Visual Basic
C#
Remarks
One of the ULStreamErrorCode values denoting the error reported by the stream itself,
ULStreamErrorCode.NONE if no error occurred.
Syntax
Visual Basic
C#
Remarks
Contains a comma separated list of error parameters for the stream error code reported in StreamErrorCode
property. This is an empty string either for errors with no parameters, or when no error has been set.
Related Information
Syntax
Visual Basic
C#
Remarks
Syntax
Visual Basic
C#
Remarks
Syntax
Visual Basic
C#
Remarks
True if the last upload synchronization was successful, false if the last upload synchronization was
unsuccessful.
Syntax
Visual Basic
C#
Members
public void DeleteAllRows() [page 555] Deletes all rows in the table.
public void FindBegin() [page 556] Prepares to perform a new Find on a ta
ble.
public bool FindFirst [page 557] Moves forward through the table from
the beginning, looking for a row that ex
actly matches a value or full set of val
ues in the current index.
public bool FindLast [page 560] Moves backward through the table from
the end, looking for a row that exactly
matches a value or full set of values in
the current index.
public void Insert() [page 568] Inserts a new row with the current col
umn values (specified using the set
methods).
public void InsertBegin() [page 569] Prepares to insert a new row into the ta
ble by setting all current column values
to their default values.
public bool LookupBackward [page 570] Moves backward through the table from
the end, looking for a row that matches
or is less than a value or full set of val
ues in the current index.
public bool LookupForward [page 574] Moves forward through the table from
the beginning, looking for a row that
matches or is greater than a value or
full set of values in the current index.
public void Truncate() [page 576] Deletes all rows in the table while tem
porarily activating a stop synchroniza
tion delete.
Properties
public new ULTableSchema Schema [page 577] Holds the table schema.
public unsafe void AppendBytes(int, byte[], int, int) [page Appends the specified subset of the
469] specified array of System.Bytes to the
new value for the specified ULDb
Type.LongBinary column.
public unsafe void AppendChars(int, char[], int, int) [page Appends the specified subset of the
471] specified array of System.Chars to the
new value for the specified ULDb
Type.LongVarchar column.
public void SetBoolean(int, bool) [page 473] Sets the value for the specified column
using a System.Boolean.
public void SetByte(int, byte) [page 474] Sets the value for the specified column
using a System.Byte (unsigned 8-bit in
teger).
public unsafe void SetBytes(int, byte[]) [page 475] Sets the value for the specified column
using an array of System.Bytes.
public unsafe void SetDateTime(int, DateTime) [page 476] Sets the value for the specified column
using a System.DateTime.
public void SetDecimal(int, decimal) [page 478] Sets the value for the specified column
using a System.Decimal.
public void SetDouble(int, double) [page 479] Sets the value for the specified column
using a System.Double.
public void SetFloat(int, float) [page 480] Sets the value for the specified column
using a System.Single.
public unsafe void SetGuid(int, Guid) [page 481] Sets the value for the specified column
using a System.Guid.
public void SetInt16(int, short) [page 483] Sets the value for the specified column
using a System.Int16.
public void SetInt32(int, int) [page 484] Sets the value for the specified column
using a System.Int32.
public void SetInt64(int, long) [page 485] Sets the value for the specified column
using an Int64.
public unsafe void SetString(int, string) [page 486] Sets the value for the specified column
using a System.String.
public unsafe void SetTimeSpan(int, TimeSpan) [page Sets the value for the specified column
487] using a System.TimeSpan.
public void SetToDefault(int) [page 488] Sets the value for the specified column
to its default value.
public void SetUInt16(int, ushort) [page 489] Sets the value for the specified column
using a System.UInt16.
public void SetUInt32(int, uint) [page 490] Sets the value for the specified column
using a System.UInt32.
public void SetUInt64(int, ulong) [page 492] Sets the value for the specified column
using a System.UInt64.
public void Update() [page 493] Updates the current row with the cur
rent column values (specified using the
set methods).
public void UpdateBegin() [page 493] Prepares to update the current row.
public override int Depth [page 347] Returns the depth of nesting for the
current row.
public override int FieldCount [page 347] Returns the number of columns in the
cursor.
public override unsafe bool GetBoolean(int) [page 310] Returns the value for the specified col
umn as a System.Boolean.
public override unsafe byte GetByte(int) [page 311] Returns the value for the specified col
umn as an unsigned 8-bit value (Sys
tem.Byte).
public unsafe byte[] GetBytes(int) [page 312] UL Ext: Returns the value for the speci
fied column as an array of Sys
tem.Bytes values.
public override unsafe long GetBytes(int, long, byte[], int, int) [page Copies a subset of the value for the
313] specified ULDbType.LongBinary col
umn, beginning at the specified offset,
to the specified offset of the destination
System.Byte array.
public override char GetChar(int) [page 315] This method is not supported in Ultra
Lite.NET.
public override unsafe long GetChars(int, long, char[], int, int) Copies a subset of the value for the
[page 316] specified ULDbType.LongVarchar col
umn, beginning at the specified offset,
to the specified offset of the destination
System.Char array.
public override string GetDataTypeName(int) [page 317] Returns the name of the specified col
umn's provider data type.
public override unsafe DateTime GetDateTime(int) [page 318] Returns the value for the specified col
umn as a System.DateTime type with
millisecond accuracy.
public override decimal GetDecimal(int) [page 319] Returns the value for the specified col
umn as a System.Decimal type.
public override unsafe double GetDouble(int) [page 320] Returns the value for the specified col
umn as a System.Double type.
public override Type GetFieldType(int) [page 321] Returns the System.Type value most
appropriate for the specified column.
public override unsafe float GetFloat(int) [page 322] Returns the value for the specified col
umn as a System.Single type.
public override unsafe Guid GetGuid(int) [page 323] Returns the value for the specified col
umn as a UUID (System.Guid) type.
public override unsafe short GetInt16(int) [page 324] Returns the value for the specified col
umn as a System.Int16 type.
public override unsafe int GetInt32(int) [page 325] Returns the value for the specified col
umn as a System.Int32 type.
public override unsafe long GetInt64(int) [page 326] Returns the value for the specified col
umn as a System.Int64 type.
public override string GetName(int) [page 327] Returns the name of the specified col
umn.
public override unsafe int GetOrdinal(string) [page 328] Returns the column ID of the named
column.
public unsafe int GetRowCount(int) [page 329] UL Ext: Returns the number of rows in
the cursor, within threshold.
public override unsafe String GetString(int) [page 332] Returns the value for the specified col
umn as a System.String type.
public unsafe TimeSpan GetTimeSpan(int) [page 333] Returns the value for the specified col
umn as a System.TimeSpan type with
millisecond accuracy.
public unsafe ushort GetUInt16(int) [page 334] Returns the value for the specified col
umn as a System.UInt16 type.
public unsafe uint GetUInt32(int) [page 335] Returns the value for the specified col
umn as a System.UInt32 type.
public unsafe ulong GetUInt64(int) [page 336] Returns the value for the specified col
umn as a System.UInt64 type.
public override object GetValue(int) [page 337] Returns the value of the specified col
umn in its native format.
public override int GetValues(object[]) [page 338] Returns all the column values for the
current row.
public override unsafe bool HasRows [page 348] Checks whether the ULDataReader ob
ject has one or more rows.
public unsafe bool IsBOF [page 348] UL Ext: Checks whether the current row
position is before the first row.
public override bool IsClosed [page 349] Checks whether the cursor is currently
open.
public override unsafe bool IsDBNull(int) [page 339] Checks whether the value from the
specified column is NULL.
public unsafe bool IsEOF [page 349] UL Ext: Checks whether the current row
position is after the last row.
public void MoveAfterLast() [page 340] UL Ext: Positions the cursor to after the
last row of the cursor.
public void MoveBeforeFirst() [page 340] UL Ext: Positions the cursor to before
the first row of the cursor.
public unsafe bool MoveFirst() [page 341] UL Ext: Positions the cursor to the first
row of the cursor.
public unsafe bool MoveLast() [page 341] UL Ext: Positions the cursor to the last
row of the cursor.
public unsafe bool MoveNext() [page 342] UL Ext: Positions the cursor to the next
row or after the last row if the cursor
was already on the last row.
public unsafe bool MovePrevious() [page 343] UL Ext: Positions the cursor to the pre
vious row or before the first row.
public unsafe bool MoveRelative(int) [page 343] UL Ext: Positions the cursor relative to
the current row.
public override bool NextResult() [page 344] Advances the ULDataReader object to
the next result when reading the results
of batch SQL statements.
public override bool Read() [page 345] Positions the cursor to the next row, or
after the last row if the cursor was al
ready on the last row.
public override int RecordsAffected [page 350] Returns the number of rows changed,
inserted, or deleted by execution of the
SQL statement.
public int RowCount [page 350] UL Ext: Returns the number of rows in
the cursor.
public ULCursorSchema Schema [page 351] UL Ext: Holds the schema of this cursor.
public override object this[int colID] [page 352] Returns the value of the specified col
umn in its native format.
public override object this[string name] [page 353] Returns the value of the specified
named column in its native format.
There is no constructor for this class. Tables are created using the ULCommand.ExecuteTable method.
In this section:
Related Information
Syntax
Visual Basic
C#
Exceptions
Remarks
In some applications, it can be useful to delete all rows from a table before downloading a new set of data into
the table. Rows can be deleted from the UltraLite database without being deleted from the consolidated
database using the ULConnection.StopSynchronizationDelete method.
Related Information
Syntax
Visual Basic
C#
Exceptions
Remarks
The value(s) for which to search are specified by calling the appropriate setType method(s) on the columns in
the index with which the table was opened.
Related Information
Moves forward through the table from the beginning, looking for a row that exactly matches a value or full set of
values in the current index.
Overload list
public bool FindFirst() [page 557] Moves forward through the table from
the beginning, looking for a row that ex
actly matches a value or full set of val
ues in the current index.
public unsafe bool FindFirst(short) [page 558] Moves forward through the table from
the beginning, looking for a row that ex
actly matches a value or partial set of
values in the current index.
In this section:
Moves forward through the table from the beginning, looking for a row that exactly matches a value or full set of
values in the current index.
Syntax
Visual Basic
C#
Exceptions
Remarks
To specify the value for which to search, set the column value for each column in the index. The cursor is left on
the first row that exactly matches the index value. On failure, the cursor position is after the last row (as shown
by the ULDataReader.IsEOF property).
Related Information
Moves forward through the table from the beginning, looking for a row that exactly matches a value or partial
set of values in the current index.
Syntax
Visual Basic
C#
numColumns For composite indexes, the number of columns to use in the find. For example, if you have a
three column index and you want to look up a value that matches based on the first column only, you
should set the value for the first column, and then supply a value of 1.
Returns
Exceptions
Remarks
To specify the value for which to search, set the column value for each column in the index. The cursor is left on
the first row that exactly matches the index value. On failure, the cursor position is after the last row (as shown
by the ULDataReader.IsEOF property).
Related Information
Moves backward through the table from the end, looking for a row that exactly matches a value or full set of
values in the current index.
Overload list
public bool FindLast() [page 560] Moves backward through the table from
the end, looking for a row that exactly
matches a value or full set of values in
the current index.
public unsafe bool FindLast(short) [page 561] Moves backward through the table from
the end, looking for a row that exactly
matches a value or partial set of values
in the current index.
In this section:
Moves backward through the table from the end, looking for a row that exactly matches a value or full set of
values in the current index.
Syntax
Visual Basic
C#
Exceptions
Remarks
To specify the value for which to search, set the column value for each column in the index. The cursor is left on
the first row found that exactly matches the index value. On failure, the cursor position is before the first row
(as shown by the ULDataReader.IsBOF property).
Related Information
Moves backward through the table from the end, looking for a row that exactly matches a value or partial set of
values in the current index.
Syntax
Visual Basic
C#
numColumns For composite indexes, the number of columns to use in the find. For example, if you have a
three column index and you want to find a value that matches based on the first column only, you should
set the value for the first column, then supply a value of 1.
Returns
Exceptions
Remarks
To specify the value for which to search, set the column value for each column in the index. The cursor is left on
the first row found that exactly matches the index value. On failure, the cursor position is before the first row
(as shown by the ULDataReader.IsBOF property).
Related Information
Continues a ULTable.FindFirst search by moving forward through the table from the current position, looking to
see if the next row exactly matches a value or full set of values in the current index.
Overload list
In this section:
Continues a ULTable.FindFirst search by moving forward through the table from the current position, looking to
see if the next row exactly matches a value or full set of values in the current index.
Syntax
Visual Basic
C#
Exceptions
Remarks
The cursor is left on the next row if it exactly matches the index value. On failure, the cursor position is after the
last row (as shown by the ULDataReader.IsEOF property).
FindNext method behavior is undefined if the column values being searched for are modified during a row
update.
Related Information
Continues a ULTable.FindFirst search by moving forward through the table from the current position, looking to
see if the next row exactly matches a value or partial set of values in the current index.
Syntax
Visual Basic
C#
numColumns For composite indexes, the number of columns to use in the find. For example, if you have a
three column index, and you want to find a value that matches based on the first column only, you should
set the value for the first column, and then supply a value of 1.
Returns
Exceptions
Remarks
The cursor is left on the next row if it exactly matches the index value. On failure, the cursor position is after the
last row (as shown by the ULDataReader.IsEOF property).
FindNext method behavior is undefined if the column values being searched for are modified during a row
update.
Related Information
Continues a ULTable.FindLast search by moving backward through the table from the current position, looking
to see if the previous row exactly matches a value or full set of values in the current index.
Overload list
In this section:
Continues a ULTable.FindLast search by moving backward through the table from the current position, looking
to see if the previous row exactly matches a value or full set of values in the current index.
Syntax
Visual Basic
C#
Exceptions
Remarks
The cursor is left on the previous row if it exactly matches the index value. On failure, the cursor position is
before the first row (as shown by the ULDataReader.IsBOF property).
FindPrevious method behavior is undefined if the column values being searched for are modified during a row
update.
Related Information
Continues a ULTable.FindLast search by moving backward through the table from the current position, looking
to see if the previous row exactly matches a value or partial set of values in the current index.
Syntax
Visual Basic
C#
numColumns For composite indexes, the number of columns to use in the find. For example, if you have a
three column index and you want to look up a value that matches based on the first column only, you
should set the value for the first column, then supply a value of 1.
Returns
Exceptions
Remarks
The cursor is left on the previous row if it exactly matches the index value. On failure, the cursor position is
before the first row (as shown by the ULDataReader.IsBOF property).
FindPrevious method behavior is undefined if the column values being searched for are modified during a row
update.
Related Information
Inserts a new row with the current column values (specified using the set methods).
Syntax
Visual Basic
Exceptions
Remarks
Related Information
Prepares to insert a new row into the table by setting all current column values to their default values.
Syntax
Visual Basic
C#
Exceptions
Call the appropriate SetType or AppendType method(s) to specify the non-default values that are to be
inserted.
The row is not actually inserted and the data in the row is not actually changed until you execute the Insert
method, and that change is not made permanent until it is committed.
Related Information
Moves backward through the table from the end, looking for a row that matches or is less than a value or full set
of values in the current index.
Overload list
public bool LookupBackward() [page 571] Moves backward through the table from
the end, looking for a row that matches
or is less than a value or full set of val
ues in the current index.
public unsafe bool LookupBackward(short) [page 572] Moves backward through the table from
the end, looking for a row that matches
or is less than a value or partial set of
values in the current index.
In this section:
Moves backward through the table from the end, looking for a row that matches or is less than a value or full set
of values in the current index.
Syntax
Visual Basic
C#
Returns
Exceptions
Remarks
To specify the value for which to search, set the column value for each column in the index. The cursor is left on
the first row that matches or is less than the index value. On failure (no rows less than the value being looked
for), the cursor position is before the first row (as shown by the ULDataReader.IsBOF property).
Related Information
Moves backward through the table from the end, looking for a row that matches or is less than a value or partial
set of values in the current index.
Syntax
Visual Basic
C#
Parameters
numColumns For composite indexes, the number of columns to use in the lookup. For example, if you have
a three column index, and you want to look up a value that matches based on the first column only, you
should set the value for the first column, and then supply a value of 1.
Returns
Exceptions
Remarks
To specify the value for which to search, set the column value for each column in the index. The cursor is left on
the first row that matches or is less than the index value. On failure (no rows less than the value being looked
for), the cursor position is before the first row (as shown by the ULDataReader.IsBOF property).
Syntax
Visual Basic
C#
Exceptions
Remarks
The value(s) for which to search are specified by calling the appropriate setType method(s) on the columns in
the index with which the table was opened.
Related Information
Moves forward through the table from the beginning, looking for a row that matches or is greater than a value
or full set of values in the current index.
Overload list
public bool LookupForward() [page 574] Moves forward through the table from
the beginning, looking for a row that
matches or is greater than a value or
full set of values in the current index.
public unsafe bool LookupForward(short) [page 575] Moves forward through the table from
the beginning, looking for a row that
matches or is greater than a value or
partial set of values in the current index.
In this section:
Moves forward through the table from the beginning, looking for a row that matches or is greater than a value
or full set of values in the current index.
Syntax
Visual Basic
C#
Exceptions
Remarks
To specify the value for which to search, set the column value for each column in the index. The cursor is left on
the first row that matches or is greater than the index value. On failure (no rows greater than the value being
looked for), the cursor position is after the last row (as shown by the ULDataReader.IsEOF property).
Related Information
Moves forward through the table from the beginning, looking for a row that matches or is greater than a value
or partial set of values in the current index.
Syntax
Visual Basic
C#
numColumns For composite indexes, the number of columns to use in the lookup. For example, if you have
a three column index and you want to look up a value that matches based on the first column only, you
should set the value for the first column, and then supply a value of 1.
Returns
Exceptions
Remarks
To specify the value for which to search, set the column value for each column in the index. The cursor is left on
the first row that matches or is greater than the index value. On failure (no rows greater than the value being
looked for), the cursor position is after the last row (as shown by the ULDataReader.IsEOF property).
Related Information
Deletes all rows in the table while temporarily activating a stop synchronization delete.
Syntax
Visual Basic
Exceptions
Related Information
Syntax
Visual Basic
C#
Remarks
This property represents the complete schema of the table, including UltraLite.NET extended information
which is not represented in the results from calling the ULDataReader.GetSchemaTable method.
Related Information
Syntax
Visual Basic
C#
Members
Methods
public unsafe string GetColumnDefaultValue(int) [page Returns the default value of the speci
582] fied column.
public unsafe ulong GetColumnPartitionSize(int) [page Returns the global autoincrement parti
583] tion size assigned to the specified col
umn.
public unsafe ULIndexSchema GetIndex(string) [page 584] Returns the index schema of the named
index.
public unsafe string GetIndexName(int) [page 584] Returns the name of the index identi
fied by the specified index ID.
public unsafe string GetOptimalIndex(int) [page 585] The optimal index for searching a table
using the specified column.
public unsafe string GetPublicationPredicate(string) [page Returns the publication predicate for
586] this table in the named publication.
public unsafe bool IsColumnAutoIncrement(int) [page Checks whether the specified column's
587] default is set to autoincrement.
public unsafe bool IsColumnCurrentDate(int) [page 588] Checks whether the specified column's
default is set to the current date (a
ULDbType.Date value).
public unsafe bool IsColumnCurrentTime(int) [page 589] Checks whether the specified column's
default is set to the current time (a
ULDbType.Time value).
public unsafe bool IsColumnCurrentTimestamp(int) [page Checks whether the specified column's
590] default is set to the current timestamp
(a ULDbType.TimeStamp value).
public unsafe bool IsColumnNewUUID(int) [page 593] Checks whether the specified column's
default is set to a new UUID (a Sys
tem.Guid value).
public unsafe bool IsColumnNullable(int) [page 594] Checks whether the specified column is
nullable.
public unsafe bool IsInPublication(string) [page 595] Checks whether the table is contained
in the named publication.
Properties
public unsafe int IndexCount [page 596] Returns the number of indexes on the
table.
public unsafe bool IsNeverSynchronized [page 596] Checks whether the table is marked as
never being synchronized.
public override string Name [page 597] Returns the name of the table.
public unsafe ULIndexSchema PrimaryKey [page 597] Returns the index schema of the pri
mary key for the table.
public unsafe bool UploadUnchangedRows [page 598] Checks whether the database uploads
rows that have not changed.
public short ColumnCount [page 266] Returns the number of columns in the
cursor.
public unsafe short GetColumnID(string) [page 258] Returns the column ID of the named
column.
public string GetColumnName(int) [page 259] Returns the name of the column identi
fied by the specified column ID.
public unsafe int GetColumnPrecision(int) [page 260] Returns the precision of the column
identified by the specified column ID if
the column is a numeric column (the
NUMERIC SQL type).
public unsafe int GetColumnScale(int) [page 261] Returns the scale of the column identi
fied by the specified column ID if the
column is a numeric column (the NU
MERIC SQL type).
public unsafe int GetColumnSize(int) [page 262] Returns the size of the column identi
fied by the specified column ID if the
column is a sized column (the BINARY
or CHAR SQL types).
public string GetColumnSQLName(int) [page 263] Returns the name of the column identi
fied by the specified column ID.
public unsafe ULDbType GetColumnULDbType(int) [page 264] Returns the UltraLite.NET data type of
the column identified by the specified
column ID.
public bool IsOpen [page 266] Checks whether the cursor schema is
currently open.
Remarks
There is no constructor for this class. A ULTableSchema object is attached to a table as its ULTable.Schema
property.
In this section:
Related Information
Syntax
Visual Basic
C#
Parameters
columnID The ID number of the column. The value must be in the range
[0,ULCursorSchema.ColumnCount-1]. The first column in a table has an ID value of zero.
Returns
The default value of the specified column as a string or a null reference (Nothing in Visual Basic) if the default
value is null.
Exceptions
Related Information
Returns the global autoincrement partition size assigned to the specified column.
Syntax
Visual Basic
C#
Parameters
columnID The ID number of the column. The value must be in the range
[0,ULCursorSchema.ColumnCount-1]. The first column in the table has an ID value of zero.
Returns
Exceptions
Remarks
All global autoincrement columns in a given table share the same global autoincrement partition.
Related Information
Syntax
Visual Basic
C#
Parameters
Returns
Exceptions
Related Information
Returns the name of the index identified by the specified index ID.
Syntax
Visual Basic
Parameters
indexID The ID of the index. The value must be in the range [1,IndexCount].
Returns
Exceptions
Remarks
Index IDs and counts may change during a schema upgrade. To correctly identify an index, access it by name or
refresh the cached IDs and counts after a schema upgrade.
Related Information
The optimal index for searching a table using the specified column.
Syntax
Visual Basic
Parameters
columnID The ID number of the column. The first column in the table has an ID value of zero.
Returns
A ULIndexSchema object representing the optimal index for the specified column.
Exceptions
Remarks
The specified column is the first column in the index, but the index may have more than one column.
Related Information
Returns the publication predicate for this table in the named publication.
Syntax
Visual Basic
Parameters
Returns
Exceptions
Syntax
Visual Basic
C#
Parameters
columnID The ID number of the column. The value must be in the range
[0,ULCursorSchema.ColumnCount-1]. The first column in the table has an ID value of zero.
Exceptions
Related Information
Checks whether the specified column's default is set to the current date (a ULDbType.Date value).
Syntax
Visual Basic
C#
Parameters
columnID The ID number of the column. The value must be in the range
[0,ULCursorSchema.ColumnCount-1]. The first column in the table has an ID value of zero.
Returns
True if the column defaults to the current date, false if the column does not default to the current date.
Related Information
Checks whether the specified column's default is set to the current time (a ULDbType.Time value).
Syntax
Visual Basic
C#
Parameters
columnID The ID number of the column. The value must be in the range
[0,ULCursorSchema.ColumnCount-1]. The first column in the table has an ID value of zero.
Returns
True if the column defaults to the current time, false if the column does not default to the current time.
Exceptions
Checks whether the specified column's default is set to the current timestamp (a ULDbType.TimeStamp
value).
Syntax
Visual Basic
C#
Parameters
columnID The ID number of the column. The value must be in the range
[0,ULCursorSchema.ColumnCount-1]. The first column in the table has an ID value of zero.
Returns
True if the column defaults to the current timestamp, false if the column does not default to the current
timestamp.
Exceptions
Related Information
Checks whether the specified column's default is set to the current UTC timestamp (a ULDbType.TimeStamp
value).
Syntax
Visual Basic
C#
Parameters
columnID The ID number of the column. The value must be in the range
[0,ULCursorSchema.ColumnCount-1]. The first column in the table has an ID value of zero.
Returns
True if the column defaults to the current UTC timestamp, false if the column does not default to the current
UTC timestamp.
Exceptions
Related Information
Syntax
Visual Basic
C#
Parameters
columnID The ID number of the column. The value must be in the range
[0,ULCursorSchema.ColumnCount-1]. The first column in the table has an ID value of zero.
Returns
Exceptions
Related Information
Checks whether the specified column's default is set to a new UUID (a System.Guid value).
Syntax
Visual Basic
C#
Parameters
columnID The ID number of the column. The value must be in the range
[0,ULCursorSchema.ColumnCount-1]. The first column in the table has an ID value of zero.
Returns
True if the column defaults to a new UUID, false if the column does not default to a new UUID.
Exceptions
Related Information
Syntax
Visual Basic
C#
Parameters
columnID The ID number of the column. The value must be in the range
[0,ULCursorSchema.ColumnCount-1]. The first column in the table has an ID value of zero.
Returns
Exceptions
Related Information
Syntax
Visual Basic
C#
Parameters
Returns
True if the table is in the publication, false if the table is not in the publication.
Exceptions
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
Remarks
Note
Index IDs and count may change during a schema upgrade. To correctly identify an index, access it by
name or refresh the cached IDs and counts after a schema upgrade.
Syntax
Visual Basic
C#
Remarks
Tables marked as never being synchronized are never synchronized, even if they are included in a publication.
These tables are sometimes referred to as "no sync" tables.
Syntax
Visual Basic
C#
Remarks
Returns the index schema of the primary key for the table.
Syntax
Visual Basic
C#
Remarks
Related Information
Checks whether the database uploads rows that have not changed.
Syntax
Visual Basic
C#
Remarks
True if the table is marked to always upload all rows during synchronization, false if the table is marked to
upload only changed rows.
Tables marked as such upload unchanged rows, as well as changed rows, when the table is synchronized.
These tables are sometimes referred to as "all sync" tables.
Syntax
Visual Basic
C#
Members
Methods
public override void Commit() [page 600] Commits the database transaction.
public override void Rollback() [page 601] Rolls back the transaction's outstand
ing changes to the database.
Properties
public new ULConnection Connection [page 601] Returns the connection associated with
the transaction.
public override IsolationLevel IsolationLevel [page 602] Returns the isolation level for the trans
action.
Remarks
There is no constructor for the ULTransaction class. To obtain a ULTransaction object, use the
ULConnection.BeginTransaction method. To associate a command with a transaction, use the
ULCommand.Transaction property.
Once a transaction has been committed or rolled back, the connection reverts to automatically committing all
operations as they are executed. To group more operations together, a new transaction must be created.
In this section:
Related Information
Syntax
Visual Basic
C#
Remarks
Once a transaction has been committed or rolled back, the connection reverts to automatically committing all
operations as they are executed. To group more operations together, a new transaction must be created.
If a Commit method call fails due to a database error (for example, a referential integrity error), the transaction
remains active. Correct the error and call the Commit method again or call the ULTransaction.Rollback method
to complete the transaction.
Related Information
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
Remarks
Once a transaction has been committed or rolled back, the connection reverts to automatically committing all
operations as they are executed. To group more operations together, a new transaction must be created.
Related Information
Syntax
Visual Basic
C#
Remarks
The ULConnection object associated with the transaction, or a null reference (Nothing in Visual Basic) if the
transaction is no longer valid.
Related Information
Syntax
Visual Basic
C#
Syntax
Visual Basic
C#
Remarks
4.1.40 ULInfoMessageEventHandler(object,
ULInfoMessageEventArgs) delegate
Syntax
Visual Basic
C#
Parameters
Related Information
Syntax
Visual Basic
C#
Remarks
The ULRowsCopiedEventHandler delegate is not available in the .NET Compact Framework 2.0.
Related Information
4.1.42 ULRowUpdatedEventHandler(object,
ULRowUpdatedEventArgs) delegate
Syntax
Visual Basic
C#
Parameters
Related Information
4.1.43 ULRowUpdatingEventHandler(object,
ULRowUpdatingEventArgs) delegate
Syntax
Visual Basic
C#
Parameters
4.1.44 ULSyncProgressedDlg(IAsyncResult,
ULSyncProgressData) delegate
Represents the method that is invoked during synchronization with synchronization progress information.
Syntax
Visual Basic
C#
Parameters
result The IAsyncResult object returned from the BeginSynchronize method. Use result.AsyncState to
access the object provided to the BeginSynchronize method.
data A ULSyncProgressData object containing the latest synchronization progress data.
Remarks
It is safe to do GUI work or to make UltraLite.NET API calls in this method. The synchronization is not being
held up during calls to this method.
Related Information
UL Ext: Enumerates the status codes that may be reported during MobiLink user authentication.
Syntax
Visual Basic
C#
enum ULAuthStatusCode
Members
Related Information
A bitwise flag that specifies one or more options to use with an instance of the ULBulkCopy class.
Syntax
Visual Basic
C#
enum ULBulkCopyOptions
Members
Remarks
The ULBulkCopyOptions class is not available in the .NET Compact Framework 2.0.
The ULBulkCopyOptions enumeration is used when you construct a ULBulkCopy instance to specify how
WriteToServer methods behave.
Syntax
Visual Basic
C#
enum ULDateOrder
Members
Syntax
Visual Basic
C#
enum ULDbType
Remarks
The table below lists which .NET types are compatible with each ULDbType. In the case of integral types, table
columns can always be set using smaller integer types, but can also be set using larger types as long as the
actual value is within the range of the type.
ULDbType Compatible .NET type C# built-in type Visual Basic built-in type
Time System.TimeSpan TimeSpan (no built-in type) TimeSpan (no built-in type)
UniqueIdentifier System.Guid Guid (no built-in type) Guid (no built-in type)
Binary columns of length 16 are fully compatible with the UniqueIdentifier type.
Related Information
Syntax
Visual Basic
enum ULDBValid
Members
Related Information
Syntax
Visual Basic
C#
enum ULRuntimeType
Related Information
UL Ext: Enumerates all the states that can occur while executing SQL passthrough scripts.
Syntax
Visual Basic
C#
enum ULSqlProgressState
Members
Related Information
UL Ext: Enumerates the types of MobiLink synchronization streams to use for synchronization.
Syntax
Visual Basic
C#
enum ULStreamType
Members
UL Ext: Enumerates all the states that can occur while synchronizing.
Syntax
Visual Basic
C#
enum ULSyncProgressState
Members
The ULSyncProgressData.SentBytes,
ULSyncProgressData.SentInserts, UL
SyncProgressData.SentUpdates, and
ULSyncProgressData.SentDeletes
properties have been updated.
The ULSyncProgressData.Received
Bytes, ULSyncProgressData.Receive
dInserts, ULSyncProgressData.Receive
dUpdates, and ULSyncProgress
Data.ReceivedDeletes properties have
been updated.
Related Information
Hyperlinks
Some links are classified by an icon and/or a mouseover text. These links provide additional information.
About the icons:
● Links with the icon : You are entering a Web site that is not hosted by SAP. By using such links, you agree (unless expressly stated otherwise in your
agreements with SAP) to this:
● The content of the linked-to site is not SAP documentation. You may not infer any product claims against SAP based on this information.
● SAP does not agree or disagree with the content on the linked-to site, nor does SAP warrant the availability and correctness. SAP shall not be liable for any
damages caused by the use of such content unless damages have been caused by SAP's gross negligence or willful misconduct.
● Links with the icon : You are leaving the documentation for that particular SAP product or service and are entering a SAP-hosted Web site. By using such
links, you agree that (unless expressly stated otherwise in your agreements with SAP) you may not infer any product claims against SAP based on this
information.
Example Code
Any software coding and/or code snippets are examples. They are not for productive use. The example code is only intended to better explain and visualize the syntax
and phrasing rules. SAP does not warrant the correctness and completeness of the example code. SAP shall not be liable for errors or damages caused by the use of
example code unless damages have been caused by SAP's gross negligence or willful misconduct.
Gender-Related Language
We try not to use genderspecific word forms and formulations. As appropriate for context and readability, SAP may use masculine word forms to refer to all genders.
SAP and other SAP products and services mentioned herein as well as
their respective logos are trademarks or registered trademarks of SAP
SE (or an SAP affiliate company) in Germany and other countries. All
other product and service names mentioned are the trademarks of their
respective companies.