The following procedure creates and configures a new Visual Studio application. You can choose whether to use Visual Basic or C# as your programming language.
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 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.
Create a Visual Studio project.
From the Visual Studio File menu, choose New » Project.
The New Project window appears. In the left pane, expand either the Visual Basic folder or the Visual C# folder. Select Smart Device as the project type.
In the right pane, select a Smart Device Project 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.
Choose Windows Mobile 5.0 Pocket PC SDK as the target platform. Click OK.
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.
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\Assembly\v2\ subdirectory of your SQL Anywhere installation. Select iAnywhere.Data.UltraLite.dll and click OK.
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 desired language (for example, use en for English). 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.
In the Files of Type list, choose Executable Files.
Open the folder corresponding to the processor of the Windows Mobile device you are using. For Visual Studio 2005 and later, open the arm.50 folder. Select ulnet11.dll; Click the arrow on the Add button and select Add as Link.
Create a form for your application.
If the Visual Studio toolbox panel is not currently displayed, from the main menu choose 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.
|Type||Design - name||Appearance - text|
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 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 Debugging.
This action deploys your application to the 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 deployment may take some time.
Confirm that the application deploys to the emulator or your target device and the form (Form1) you have designed is displayed correctly.
Shutdown the emulator or the application on your target device.
|Envoyer votre avis sur cette page par email.||Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1|