viewbarcode.com

Build an ASP.NET Web Service Project to Access an Oracle Database in .NET Deploy PDF 417 in .NET Build an ASP.NET Web Service Project to Access an Oracle Database




How to generate, print barcode using .NET, Java sdk library control with example project source code free download:
8.8 Build an ASP.NET Web Service Project to Access an Oracle Database using visual studio .net toinsert pdf417 with asp.net web,windows application Postnet 3 of 5 8.8.1 Build a Web Service Project WebServiceOracleSelect In this section, we modify th e existing Web Service project WebServiceSQLSelect to make it into our new Web Service project WebServiceOracleSelect and allow it to access the Oracle database to perform data selection queries. Open the Windows Explorer and create a new folder, 8, under the root directory if you have not done that already. Open Internet Explorer and browse to our desired source Web Service project, WebServiceSQLSelect which is located at www.

cambridge.org/9780521712354 in the folder DBProjects\ 8, and copy and paste it into our new folder 8. Rename it WebServiceOracleSelect.

Perform the following modi cations to this project: 1. Change the main Web Service page from WebServiceSQLSelect.asmx to WebServiceOracleSelect.

asmx. 2. Open the App Code folder and change the name of our base class le from SQLSelectBase.

vb to OracleSelectBase.vb. 3.

Open the App Code folder and change the name of our derived class le from SQLSelectResult.vb to OracleSelectResult.vb.

4. Open the App Code folder and change the name of our code-behind page from WebServiceSQLSelect.vb to WebServiceOracleSelect.

vb. Now open Visual Studio.NET 2005 and our new Web Service project WebServiceOracleSelect to perform the associated modi cations to the contents of the les we renamed above.

First, let s perform the modi cations to our main Web Service page WebServiceOracleSelect.asmx. Open this page by double-clicking it from the Solution Explorer window and perform the following modi cations: Change CodeBehind = /App Code/WebServiceSQLSelect.

vb to CodeBehind = /App Code/WebServiceOracleSelect.vb Change Class = WebServiceSQLSelect to Class = WebServiceOracleSelect Second, open the base class le OracleSelectBase.vb and perform the following modi cations: Change the class name from SQLSelectBase to OracleSelectBase Change the name of the rst member data from SQLRequestOK to OracleRequestOK Change the name of the second member data from SQLRequestError to OracleRequestError Next, open the derived class le OracleSelectResult.

vb by double-clicking it from the Solution Explorer window, and perform the following modi cations: Change the class name from SQLSelectResult to OracleSelectResult Change the base class name (after the keyword Inherits) from SQLSelectBase to OracleSelectBase. ASP.NET Web Services 8.8.2 Modify the Connection String Double-click our Web con gura pdf417 2d barcode for .NET tion le Web.con g from the Solution Explorer window to open it.

Change the content of the connection string that is under the tag <connectionStrings> to:. <add name = ora conn connectionString = Server = XE;User ID = SYSTEM;Password = reback; /> The Oracle database server XE Visual Studio .NET PDF 417 is used for the server name, the User ID is the default value SYSTEM, and the password is determined by the user when installing the Oracle Database 10g Express Edition in the local computer..

8.8.3 Modify the Namespace Directories First, we need to add an Orac PDF-417 2d barcode for .NET le Data Provider reference to our Web Service project. To do that, right-click our new project icon WebServiceOracleSelect from the Solution Explorer window, and then select the item Add Reference from the popup menu to open the Add Reference dialog box.

Browse down the list until you nd the item System.Data.OracleClient, click to select it, and then click the OK button to add it into our project.

Now double-click our code-behind page WebServiceOracleSelect.vb to open it. On the page, change the last namespace line from.

Imports System.Data.SqlClient Imports System.Data.OracleClient Also change the name of our W eb Service class, which is located after the accessing mode Public Class, from WebServiceSQLSelect to WebServiceOracleSelect. Next, we will perform the necessary modi cations to three Web methods combined with those ve differences listed above..

8.8.4 Modify the Web Method GetSQLSelect and Related Subroutines The following issues are rela ted to this modi cation: 1. 2. 3.

4. 5. The name of this Web method and the name of the returned data type class The query string used in this Web method The names of the data components used in this Web method The subroutines SQLConn() and ReportError() The name of the dynamic parameter.

8.8 Build an ASP.NET Web Service Project to Access an Oracle Database Let s perform those modi cati ons step by step according to this sequence. A. Rename this Web method GetOracleSelect, and change the name of returned class to OracleSelectResult.

B. Modify the query string by replacing the LIKE @ symbol before the dynamic parameter facultyName with the symbol =:, which is an assignment operator used in the Oracle database. C.

Change the pre x from Sql to Oracle for all data classes, and from sql to ora for all data objects. Also change the returned instance name from SQLResult to OracleResult, and change the derived class name from SQLSelectResult to OracleSelectResult. D.

Change the name of the returned instance from SQLResult to OracleResult, and member data from SQLRequestOK to OracleRequestOK. E. Change the name of the subroutine from SQLConn to OracleConn.

F. Change the pre x from sql; to ora for all data objects. G.

Modify the nominal name of the dynamic parameter by removing the @ symbol before the nominal name facultyName. Also change its data type from SqlDbType.Text to OracleType.

VarChar. H. Change the name of the returned instance from SQLResult to OracleResult, and change the pre x from sql to ora for all data objects.

Your modi ed Web method GetOracleSelect() should match the one shown in Figure 8.126. The modi cations are highlighted in bold.

Now let s perform the modi cations to three related subroutines. Perform the following modi cations to the subroutine SQLConn(): A. Change the name of this subroutine from SQLConn to OracleConn, and the return class name from SqlConnection to OracleConnection.

Also change the connection string from sql conn to ora conn. B. Change the data type of the returned connection object to OracleConnection.

Perform the following modi cations to the subroutine FillFacultyReader(): C. Change the data type of the rst passed argument from SQLSelectResult to OracleSelectResult. Also change the data type of the second passed argument from SqlDataReader to OracleDataReader.

Perform the following modi cations to the subroutine ReportError(): D. Change the data type of the passed argument from SQLSelectResult to OracleSelectResult. E.

Change the name of the rst member data from SQLRequestOK to OracleRequestOK. F. Change the name of the second member data from SQLRequestError to OracleRequestError.

Your modi ed subroutines OracleConn(), FillFacultyReader(), and ReportError() should match those shown in Figure 8.127. All modi cations are highlighted in bold.

.
Copyright © viewbarcode.com . All rights reserved.