- SQL Anywhere 11
- Microsoft Visual Studio 2008
- Start Visual Studio.
- Select File > New > Project.
- From the 'New Project' dialog, choose Visual C# > ASP.NET Web Application.
- Name the project 'Sample', and save it to a known location of your choice.
- Click OK. This will automatically generate the project content, including a Default.aspx web page.
- Open the Default.aspx web page in design mode, by double-clicking the file from the Solution Explorer, and then clicking on the Design tab located to the bottom of the editor.
- From the Toolbox, double-click on DataList to add the control to the web page.
- Click on the > button located to the top-right of the DataList, to expose the task menu. From the Choose Data Source list, choose >New data source…>. This will bring up the Data Source Configuration Wizard.
- Select Database, and give it an ID of 'SADemoDB'. Click OK.
- In the dialog that follows, either choose an existing data connection, or to connect to the sample database, click the New Connection… button. Set the Data source to SQL Anywhere (SQL Anywhere 11), and choose the ODBC Data Source name as 'SQL Anywhere 11 Demo'. Use 'dba' as the User ID, and 'sql' as the Password. Click OK.
- Click Next > to accept the connection and parameters, and then click Next > again to use the default name of ConnectionString.
- In the dialog that follows, choose Customers as the table, and select the Surname, GivenName, and CompanyName fields. Click Next >.
- You can test the query to ensure that all parameters have been set correctly by pressing the Test Query button. Click Finish. Visual studio will automatically create a table in the DataList control.
- Hit F5 to view the hosted page. Visual studio will host the page in a development server, and launch Internet Explorer. The resulting web page should look like this: