The SQL Anywhere .NET Data Provider can be used to develop applications with Visual Studio 2005 or later versions. To use the SQL Anywhere .NET Data Provider, you must include two items in your Visual Studio project:
These steps are explained below.
For information about installing and registering the SQL Anywhere .NET Data Provider, see Deploying the SQL Anywhere .NET Data Provider.
Adding a reference tells Visual Studio which DLL to include to find the code for the SQL Anywhere .NET Data Provider.
To add a reference to the SQL Anywhere .NET Data Provider in a Visual Studio project
Start Visual Studio and open your project.
In the Solution Explorer window, right-click References and choose Add Reference from the popup menu.
The Add Reference window appears.
On the .NET tab, click Browse to locate iAnywhere.Data.SQLAnywhere.dll. Note that there are separate versions of the DLL for each of Windows and Windows Mobile platforms.
Select the DLL and then click Open.
For a complete list of installed DLLs, see SQL Anywhere .NET Data Provider required files.
You can verify that the DLL is added to your project. Open the Add Reference window and then click the .NET tab. iAnywhere.Data.SQLAnywhere.dll appears in the Selected Components list. Click OK to close the window.
The DLL is added to the References folder in the Solution Explorer window of your project.
To facilitate the use of the SQL Anywhere .NET Data Provider namespace and the types defined in this namespace, you should add a directive to your source code.
To facilitate the use of Data Provider namespace in your code
Start Visual Studio and open your project.
Add the following line to your project:
using
directives at the beginning of your project:
using iAnywhere.Data.SQLAnywhere; |
Public Class Form1
:
Imports iAnywhere.Data.SQLAnywhere |
This directive is not required, however, it allows you to use short forms for the SQL Anywhere .NET classes. For example:
SAConnection conn = new SAConnection() |
Without this directive, you can still use the following:
iAnywhere.Data.SQLAnywhere.SAConnection conn = new iAnywhere.Data.SQLAnywhere.SAConnection() |
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |