SQL Anywhere Integration with Visual Studio 2005

SQL Anywhere Integration with Visual Studio 2005SQL Anywhere 10 contains a number of integration features with Microsoft Visual Studio .NET (both 2003 and 2005). These features are designed to make it easier to work with a SQL Anywhere database while developing an application using Visual Studio. This whitepaper outlines the integration features that are present with Visual Studio 2005, and contains tutorials demonstrating how the integration features can be used to ease application development while working with a database.

SERVER EXPLORER PLUG-IN
The Visual Studio Server Explorer can be used to display information about databases, such as their schema, and the data they contain. You can also modify the data stored in database tables using the Server Explorer.
OPENING THE SERVER EXPLORER
1. In Visual Studio, choose View > Other Windows > Server Explorer. The Server Explorer appears on the screen, replacing the Toolbox. To switch back to the Toolbox, click the Toolbox tab. If the Server Explorer is docked to the side of your screen, tabs appear along the side.
2. Right-click Data Connections, and then choose Add Connection. The Add Connection dialog appears.
3. If the Data Source is not set to SQL Anywhere (SQL Anywhere 10), click the Change button and select SQL Anywhere from the list.
4. Type SQL Anywhere 10 Demo in the ODBC Data Source name field.
5. In the User ID field, type DBA, and in the Password field, type sql.
6. Click Test Connection to test the supplied parameters. A message box alerts you to a successful connection or any problems.
7. Click OK to add the connection. The Server Explorer now displays the new connection-SQL Anywhere.demo10.
8. Expand the connection and the Tables entry below it. The Server Explorer shows you all the tables that are in your database. To view the schema for one of the tables, click the + beside its name. For example, expand the Departments table to look at its schema:
The department table contains three columns: DepartmentID, DepartmentName, and DepartmentHeadID.
9. To view the data stored in this table, right-click the table name, and choose Show Table Data. The main area in Visual Studio displays the data. Click in a cell to edit the data in that cell. Any changes that you make are automatically committed to the database.
10. To add a new row of data to the table, enter the data in the row that has * (asterisk) to the left of it.

SQL ANYWHERE INTEGRATION COMPONENTS
The SQL Anywhere integration components allow application designers to interact with a database both from within the Visual Studio development environment, as well as from within their code.
The SADataAdapter component is of particular interest. It allows an application designer to retrieve result sets from the database easily and store them in a DataSet object (DataSet). The data in the DataSet object can be edited, and the SADataAdapter automatically updates the database with the changes.

Website: www.sybase.com | Filesize: 407kb
No of Page(s): 25
Click here to download SQL Anywhere Integration with Visual Studio 2005.

Related Tutorial

Tags: , , ,

Comments

Leave a Reply