Tutorial: Build an UltraLite.NET Application
The following procedure creates and configures a new Visual Studio application. You can choose whether to use Visual Basic.NET or C# as your programming language.
To create a Visual Studio project
Create a Visual Studio project .
From the Visual Studio .NET 2003 File menu, choose New > Project to create a new project.
The New Project window appears.
In the left pane, select either the Visual Basic Projects folder or the Visual C# Projects folder.
In the right pane, select a Smart Device Application and name your project VBApp or CSApp, depending on whether you choose Visual Basic or C# for the programming language.
Enter a Location of c:\tutorial\uldotnet and click OK.
The Smart Device Application Wizard appears.
Choose Pocket PC as the target platform, and select Windows Application as the project type. Click OK.
A Design workspace appears, displaying a form.
Add references to your project.
Add the iAnywhere.Data.UltraLite assembly and the associated resources to your project.
From the Project menu, choose Add Reference.
The Add Reference window appears.
Select iAnywhere.Data.UltraLite (CE) from the list of available references. Click Select to add it to the list of selected components.
If this reference does not appear in the list, click Browse and locate it in the ultralite\UltraLite.NET\ce subdirectory of your SQL Anywhere installation. Select iAnywhere.Data.UltraLite.dll and click Open.
Select iAnywhere.Data.UltraLite (CE) EN from the list of available references. Click Select to add it to the list of selected components.
If this reference does not appear in the list, click Browse and locate it in the ultralite\UltraLite.NET\ce\xx subdirectory of your SQL Anywhere installation, where xx is a two-letter abbreviation for the language. Select iAnywhere.Data.UltraLite.resources.dll and click Open.
Click OK to add the assembly and resources to your project.
Link the UltraLite component to your project.
In this step, ensure that you add a link to the component, and that you do not Open the component.
From the Project menu, choose Add Existing Item and browse to the ultralite\UltraLite.NET\ce subdirectory of your SQL Anywhere installation.
Set the Files of Type drop down to All Files so that DLL files are displayed.
Open the folder corresponding to the processor of the CE device you are using (for the Pocket PC emulator, open the x86 folder) and select ulnet9.dll. Do not click Open.
Click the arrow on the Open button and select Link File to link it to your project.
Create a form for your application.
Add the following visual components to the form.
| Type | Name | Text |
|---|---|---|
| Button | btnInsert | Insert |
| Button | btnUpdate | Update |
| Button | btnDelete | Delete |
| TextBox | txtName | |
| ListBox | lbNames | |
| Label | laName | Name |
Your form should look like the following figure.
Build and deploy your solution.
Building and deploying the solution confirms that you have configured your Visual Studio.NET project properly.
From the Build menu, choose Build Solution. Confirm that the project builds successfully.
From the Debug menu, choose Start. This action deploys your application to the device or emulator, and starts it. The application is deployed to \Program Files\VBApp or \Program Files\CSApp depending on your project name.
The deployment may take some time.
Confirm that the application deploys to the emulator or your target device.
From the Debug menu, choose Stop Debugging to close the application.
SQL Anywhere Studio 9.0.2
Copyright © 1989–2004 Sybase, Inc. Portions copyright © 2001–2004 iAnywhere Solutions, Inc. All rights reserved.