Building ASP.NET Web Applications with Oracle Developer Tools for Visual Studio

Purpose

This tutorial describes how you can build ASP.NET web applications that access Oracle Database using Oracle Developer Tools for Visual Studio.

Time to Complete

Approximately 20 minutes

Topics

This tutorial covers the following topics:

 Overview
 Prerequisites
 Creating a Web Site
 Creating the GridView
 Creating a Data Source
 Executing your Web Site
 Summary

Viewing Screenshots

 Place the cursor over this icon to load and view all the screenshots for this tutorial. (Caution: This action loads all screenshots simultaneously, so response time may be slow depending on your Internet connection.)

Note: Alternatively, you can place the cursor over an individual icon in the following steps to load and view only the screenshot associated with that step. You can hide an individual screenshot by clicking it.

Overview

Oracle Developer Tools for Visual Studio is a tightly integrated "add-in" for Visual Studio. This tight integration makes it easy to create ASP.NET Web Applications that access Oracle database without requiring the developer write much code.

Back to Topic List

Prerequisites

Before you perform this tutorial, you should:

1.

Install Microsoft Visual Studio 2008

2.

Install Oracle Database 9.2 or later or Oracle Database XE

3.

Install Oracle 11g Oracle Data Access Components (ODAC) with Oracle Developer Tools for Visual Studio version 11.1.0.6.20 or later from OTN

Back to Topic List

Creating a Web Site

To create an ASP.NET web site, perform the following steps:

1.

From your Windows Start menu, start Visual Studio.

 

2.

From File menu, select New Web Site.

 

3.

In the New Web Site window, select ASP.NET Web Site and click OK.

 

Back to Topic List

Creating the GridView

To create a gridview, perform the following steps:

1.

In the Default.aspx tabbed page, click the Design tab.

You get a blank canvas as shown in the screenshot below.

 

2.

From View menu, select Toolbox.

 

3.

Scroll down. In the toolbox, expand Data. Drag the GridView control to the Design area.

The design area gets the Gridview control as shown in the screenshot below.

Back to Topic List

Creating a Data Source

To create a new data source, perform the following steps:

1.

If you do not see the GridView Tasks pane, click the >symbol to get it, as highlighted in the screenshot.

Select <New data source...> from the Choose Data Source drop down.

A Data Source Configuration wizard starts.

 

2.

Select Database. Enter HR as the ID for the data source. Click OK.

 

3.

Click New Connection...

 

4.

In the Change Data Source dialog box, select Oracle Database Server as the Data Source and Oracle Data Provider for .NET as the Data Provider.

 

4.

Click OK.

 

5.

Enter ORCL for Data source name, and HR for the Username and Password. Click Test Connection.

 

6.

Your test was successful. Click OK.

 

7.

Click OK.

 

8.

Click Next.

 

9.

Click Next to save the connect string in the application configuration file.

 

10.

Select the EMPLOYEES table from the Name drop down. Click the checkbox in front of *. Click Next.

 

11.

Click Test Query.

 

12.

The result of your query is shown. Click Finish.

 

13.

Click the Enable Paging checkbox.

 

Back to Topic List

Executing your Web Site

To run the ASP.NET web application, perform the following steps:

1.

Select Build > Build Web Site.

 

2.

Your website was built.

 

3.

Select Debug > Start Debugging.

 

4.

Click OK to modify the web.config file to enable debugging.

 

5.

A web browser will open showing the web application.

 

Back to Topic List

Summary

In this tutorial, you learned how to:

 Create a ASP.NET web site
 Create a GridView
 Create a new Data Source
 Execute your web site

Back to Topic List

 Move your mouse over this icon to hide all screenshots.

 

Left Curve
Popular Downloads
Right Curve
Untitled Document