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.
Create a Visual Studio project.
From the Visual Studio 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 are using 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 named Form1.
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.
Choose All Files from the Files of Type dropdown list so that DLL files appear.
Open the folder corresponding to the processor of the CE device you are using. For Pocket PC emulator in Visual Studio .NET 2003 open the x86 folder, but for Visual Studio 2005 open the ARM folder. Select ulnet10.dll; do not click Open.
Click the arrow on the Open button and select Link File to link it to your project.
If you are using Visual Studio 2005, set the Build Action property of the dll to Content and set the Copy to Output Directory property to Copy if newer.
Create a form for your application.
If the Visual Studio toolbox panel is not currently displayed, choose View > Toolbox from the main menu. 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.
Type | Name | Text |
---|---|---|
Button | btnInsert | Insert |
Button | btnUpdate | Update |
Button | btnDelete | Delete |
TextBox | txtName | (no text) |
ListBox | lbNames | (no text) |
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. If you are building a Visual Basic application, you can ignore the following warning that may appear:
Referenced assembly 'iAnywhere.Data.UltraLite.resources' is a localized satellite assembly
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.