This document explains how to dynamically create a connection to a SQL Anywhere Studio database through a C# project.
Required Software
- Sybase SQL Anywhere Studio 7.x or later
- asademo.db file (included with Adaptive Server Anywhere)
- ASA 8.0 Sample data source (created by default when Adaptive Server Anywhere is installed)
- Microsoft Visual Studio .Net version 7.0
- Windows NT, 98, 2000, Me, or XP
Steps
- Start Visual Studio .Net.
- Create a new project. Select Visual C# Projects from the left side.
- Select Console Application from the right side.
- Enter the project name CustomerDataReader.
- Enter the project location: c:\temp.
- Click OK to close the New Project dialog.
- In your code, you must set the System.Data name space. This is where all the ADO.Net classes are located. Enter the following using directive at the beginning of your project:
Using system.Data;
- The next required using directive is the OLE DB .Net Data Provider. Add the following using directive to your project