ODP .NET Developer''''s Guide oracle database 10g development with visual studio 2005 phần 9 pps

29 230 0
ODP .NET Developer''''s Guide oracle database 10g development with visual studio 2005 phần 9 pps

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Chapter 8 [ 255 ] Consuming the Web Service from ASP.NET Now, we will develop an ASP.NET web application that consumes the web service developed previously. The following are the steps: 1. Open Visual Studio 2005 environment. 2. Create a new website by going to File | New | Web Site and provide the information as shown in the following screenshot: 3. Using the Solution Explorer, right-click on the project and go to Add Web Reference as follows: Application Development Using ODP.NET [ 256 ] 4. Browse the Web services on the local machine as shown below (if the web service is available on your local machine). 5. Select the web service created earlier: Chapter 8 [ 257 ] 6. Provide the Web reference name as EmpService and click on Add Reference: 7. Drag a GridView control and an ObjectDataSource control on to the web form and congure the data source of ObjectDataSource (using the smart tag) as follows: Application Development Using ODP.NET [ 258 ] 8. Click Next and provide the SELECT method as getList() as follows: 9. Similarly, provide the UPDATE method as Update(), INSERT method as Add(), DELETE method as Delete(), and nally click on and nally click on Finish. Chapter 8 [ 259 ] 10. Using the smart tag of the GridView, congure its properties as follows: 11. Using the Properties window provide the DataKeyNames property of the GridView as empno. 12. Press F5 to test and execute the application. Developing Smart Device Applications Microsoft Windows Mobile Platform is now fully supported with .NET technology. We can develop and deploy .NET-based applications directly on to smart devices enabled with Microsoft Windows Mobile operating system. Before proceeding with developing smart device applications, let us discuss Microsoft Windows Mobile platform and the devices supporting it. Introducing Microsoft Windows Mobile There exist several types of smart devices in the market including Smart Phones, Pocket PCs, Pocket PC Phones, Tablet PCs, etc. Every smart device is installed with a mobile-based operating system with respect to the features of the device. One of such operating systems is Microsoft Windows CE. Microsoft Windows CE is a small, embedded operating system (runs from ROM) that has a look and feel similar to Microsoft Windows 95/98. It includes scaled down versions of Microsoft Excel, Microsoft Word, Microsoft Internet Explorer, etc. Application Development Using ODP.NET [ 260 ] Microsoft Windows Mobile (Windows Mobile in short) is a complete software platform built on Windows CE. Unlike Windows CE, the Windows Mobile for Smart Phone or Pocket PC operating systems is specically designed for devices that require a specialized hardware conguration. The software includes standardized interfaces and applications that ensure compatibility across hardware designs. The Pocket PC is the best example device that gets equipped with Microsoft Windows Mobile operating system. The Pocket PC runs Windows CE as its core operating system. Pocket PCs come with mobile versions of Microsoft Ofce applications in addition to Microsoft Outlook Mobile. Though there are different Pocket PCs, many come with Wi-Fi to enable you to connect to the Internet when you are near to a wireless hotspot. You can compose email messages and send them wirelessly or by synchronizing with your desktop computer. A Pocket PC Phone is a bit different from an ordinary Pocket PC. You can do everything with a Pocket PC Phone that you can do with a Pocket PC, but with the addition of cellular phone capabilities. If you have a Pocket PC Phone, you can access the Internet through the GPRS service. A Smart Phone has phone capabilities and comes with a smaller set of applications. Though you can add third-party software titles to your Smart Phone, the smaller keypad and screen are designed to give you quick one-handed access to important data. A Smart Phone is a good choice for business users who need to check email, keep track of their calendars, and take voice notes. Microsoft.NET enables us to develop and deploy .NET applications on Microsoft Windows Mobile-enabled smart devices like Smart Phones, Pocket PCs, Tablet PCs, etc. To develop for either Smart Phones or Pocket PCs, we need not really buy those devices. We simply need to have smart device client extensions installed as a part of Visual Studio 2005 (which automatically installs .NET Compact Edition). When the extensions are installed, we are provided with few device emulators for developing and testing .NET-based mobile applications. However, for testing and production, it is recommended to have physical smart devices. The next section focuses on developing a simple Pocket PC application, which consumes the web service developed previously. Consuming a Web Service from Pocket PC We have already developed a web service previously. Now, let us make use of the same web service for the Pocket PC. You need not have a physical Pocket PC in your hands to test it. Chapter 8 [ 261 ] We can simply use existing emulators available as part of Visual Studio 2005. The following are the steps: 1. Open Visual Studio 2005 Environment. 2. Go to File | New | Project. 3. Select and provide information as shown in the following gure: 4. Add a Web Reference for the web service you created earlier. Application Development Using ODP.NET [ 262 ] 5. Drag and drop a DataGrid on to the Pocket PC emulator as shown below: 6. Modify the existing code as follows: Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.DataGrid1.DataSource = (New EmpService.Service).getList.Tables(0) End Sub End Class Chapter 8 [ 263 ] 7. Press F5, and select any Emulator for deployment. The output should look and select any Emulator for deployment. The output should look like the following: Summary In this chapter, we concentrated on real-world application development covering the aspects of asynchronous and multi-threaded development, web applications (ASP.NET), web reporting, object-oriented development, web services development, and smart device (Pocket PC) application development. [...]...Introduction to Oracle Developer Tools for Visual Studio 2005 Oracle Developer Tools for Visual Studio is an "add-in" for Microsoft Visual Studio 2003 /2005, which helps developers to work with Oracle database and develop Oracle based NET applications without leaving the Visual Studio Environment You can download it for free from http://www .oracle. com/technology/software/ tech/windows/odpnet/index.html... to Oracle database using Oracle client Connecting to Oracle from Visual Studio Using Oracle Explorer Once ODT is installed on your system, you should be able to observe the Oracle Explorer option in the View menu as follows: [ 266 ] Chapter 9 Oracle Explorer allows you to connect to and work with Oracle database from within the Visual Studio environment It is very similar to Server Explorer (in Visual. .. Oracle Developer Tools for Visual Studio • Creating and debugging PL/SQL stored procedures using Visual Studio • Developing applications using the Automatic Code Generation feature of ODT • Developing and deploying NET CLR stored procedures in Oracle database using Visual Studio Features of Oracle Developer Tools Oracle has released Oracle Developer Tools (ODT in short) for Visual Studio NET 2003 /2005. .. for Visual Studio 2005 Once you hit Test connection, you should see the following message: [ 268 ] Chapter 9 After hitting OK twice, you will see scott.xe added to Data Connections Once you open the scott.xe tree and further open the Tables folder, you should be able to view the following: [ 2 69 ] Introduction to Oracle Developer Tools for Visual Studio 2005 Retrieving Oracle Information from Visual Studio. .. (in Visual Studio) except that it works only with Oracle databases Once you click on Oracle Explorer, you should be able to see the following: Using the Oracle Explorer window, you can connect to Oracle database using Add Connection as follows: Once you are prompted with the Add Connection dialog box, you can provide your own connection parameters similar to following: [ 267 ] Introduction to Oracle Developer... access Oracle databases When ODT gets installed, the most important feature we notice is the Oracle Explorer (available through the View menu of Visual Studio. NET) It allows us to browse existing Oracle objects (like tables, views, stored procedures, etc.), create or modify tables using table designer, view or edit data, execute SQL statements, etc Introduction to Oracle Developer Tools for Visual Studio. .. Chapter 9 Go to the Tools menu and switch on Oracle Application Debugging as follows: Go to the Tools menu again and within the Options, switch on PL/SQL debugging (of ODT) for all the necessary connections (you may have to connect to the database using Oracle Explorer prior to doing this) as follows: [ 281 ] Introduction to Oracle Developer Tools for Visual Studio 2005 Develop a stored procedure in Oracle. .. the Visual Studio environment where we can view or modify the information as follows: [ 272 ] Chapter 9 If you would like to write your own query, execute it, and view the results, you can use the Query Window option as follows: Once the Query Window is opened, you can provide your own query and execute it as follows: [ 273 ] Introduction to Oracle Developer Tools for Visual Studio 2005 Working with Oracle. .. Oracle Developer Tools for Visual Studio 2005 Working with Oracle Database Objects from Visual Studio Using ODT We can create, modify, and drop different database objects from within the Visual Studio environment using ODT All of the most important database objects that are frequently used by developers are accessible through ODT Dealing with Tables, Views, and Sequences Using ODT You can create a new... indexes, etc.) visually as follows: [ 274 ] Chapter 9 You can create or modify views in Oracle as follows: [ 275 ] Introduction to Oracle Developer Tools for Visual Studio 2005 You can also create and work with sequences by right-clicking on the Sequences folder as follows: The following screenshot defines a sequence named EMPSEQ,����������������� 1001 which starts at and ends at 2001 with an incremental . .NET CLR stored procedures in Oracle database using Visual Studio Features of Oracle Developer Tools Oracle has released Oracle Developer Tools (ODT in short) for Visual Studio .NET 2003 /2005. with Oracle database from within the Visual Studio environment. It is very similar to Server Explorer (in Visual Studio) except that it works only with Oracle databases. Once you click on Oracle. application development. Introduction to Oracle Developer Tools for Visual Studio 2005 Oracle Developer Tools for Visual Studio is an "add-in" for Microsoft Visual Studio 2003 /2005, which

Ngày đăng: 08/08/2014, 20:21

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan