Example 33 Easy Connect Naming Method Syntax for Data Source
user id id password psswd data source host port service_name id is the user id we will use hr to access the HR schema. psswd is the password in this book, we use hr password for the HR schema. host is the DNS name of the server machine to which the XE client will make the connection, such as hr-server in the following example of valid connections. port optional , if not specified, uses the default value of 1521, which is the server port number from which the client connects to the database....
Copying a Project
For this chapter, you need to use the application developed in Chapter 3, Connecting to the Database. Follow these steps to copy the project to a new directory. 1. Complete all steps in Chapter 3, Connecting to the Database. 2. Using the Windows Explorer, navigate to the directory C HR Visual Studio Projects. Make a copy of the entire folder HR_Connect_CS HR_Connect_VB for Visual Basic , and rename the new folder HR_ODP_CS HR_ODP_VB for Visual Basic . 2. Using the Windows Explorer, navigate to...
Deploying NET Stored Functions and Procedures
Follow these steps to deploy a .NET Stored Procedure 1. From the Build menu, select Deploy Solution. An Oracle Deployment Wizard for .NET window appears. 2. In the Oracle Deployment Wizard for .NET window, click Next. 3. On the Configure Your Connection window, click New Connection. 3. On the Configure Your Connection window, click New Connection. 4. You must now establish a connection with SYSDBA privileges. For the Data Source Name, use Local Database . For Password, enter the current sys...
Example 418 Using DataSet Class Declaring Variables VB
Private cmd As OracleCommand Private da As OracleDataAdapter Private cb As OracleCommandBuilder Private ds As DataSet HR_DataSet_ODP_CS - Microsoft Visual Cff .NET design - Forml .cs File Edit View Project Build Debug lools Window Help private OracleConnection conn new OracleConnection private OracleCommand cmd private OracleDataAdapter da private OracleCommandBuilder cb private DataSet ds 11. Within the Form method, add the code shown in Example 4-19 and Example 4-20. Example 4-19 Disabling...
Example 822 Changing the Date Format and Updating the DataSet VB
si.DateFormat YYYY-MM-DD conn.SetSessionInfo si departments.DataSource ds.Tables 0 12. Save Forml using Ctr S keyboard shortcut. 13. Run the application using the F5 keyboard shortcut. 14. After you successfully connect to the database, the data grid is populated with the results of the query. Click Change Date Format. 15. Note that the date format is changed from the original DD-MON-RR to YYYY-MM-DD. Thread-based globalization parameter settings are specific to each thread. Initially, these...
Starting the Common Language Runtime Service
To use .NET Stored Procedures, you must first start the XE Common Language Runtime agent, represented by the OracleXEClrAgent service. This service may not start by default. Note that it is located on the Oracle XE database server, not on the client. 1. From the Start menu, select All Programs, then select Administrative Tools, and Component Services Computer Management J Data Sources ODBC IT Event Viewer 1 Microsoft .NET Framework 1.1 Confii 1 Microsoft .NET Framework 1.1 Wizar 2. In the...
Select Oracle Developer Tools for Visual Studio NET from the list of programs
ftf Oracle Developer Tools for Visual Studio MET For Oracle Database Express Edition Currently installed programs J show updates Sort by ftf Oracle Developer Tools for Visual Studio MET For Oracle Database Express Edition To change this program or remove it from your computer, click Change or Remove. Used frequently Last Used On 11 3 2005 4. On the Add or Remove Programs confirmation dialog box, click Yes.
Introduction to Ref Cursors
Ref cursors are one of the most powerful, flexible, and scalable methods for returning query results from an Oracle Database to a client application. A ref cursor is a PL SQL datatype whose value is the address of the memory location of a query work area on the database server. A query work area can be thought of as the result set, or a row set, on the server it is the location where the results of a query are stored in server memory. In essence, a ref cursor is a handle to a result set on the...
Example 85 Testing NLS Number Format Settings
SQL gt SELECT employee_id ID, 2 SUBSTR first_name,1,1 ' last_name Name, 3 TO_CHAR salary, '99G999D99' Salary 5 FROM employees 6 WHERE employee_id lt 105 3. The result of the query returns in the American format specified in Step 1. 6 WHERE employee_id lt 105 3. The result of the query returns in the American format specified in Step 1. 4. Enter the command in Example 8-6 at the SQL prompt.
Client Globalization Support in Oracle Data Provider for NET
Oracle Data Provider for .NET enables applications to manipulate culture-sensitive data, such as ensuring proper string format, date, time, monetary, numeric, sort order, and calendar support using culture conventions defined in the Oracle Database XE. The default globalization settings are determined by the client's NLS_LANG parameter, which is defined in the Windows Registry of the local computer. When the OracleConnection call Open establishes a connection, it implicitly opens a session with...
Adding a Reference
To connect the project to an Oracle database, you must add a reference to the Oracle. DataAccess.dll, which contains the data provider. 1. If it is not already active, start the Solution Explorer from the View menu, select Solution Explorer. 9 HR_Connect_CS - Microsoft Visual .NET design - Forml .cs 9 HR_Connect_CS - Microsoft Visual .NET design - Forml .cs The Solution Explorer appears in the window. 2. In the Solution Explorer, select the References node, right click and select Add Reference....
Example 812 Setting NLSLANGUAGE Parameter French
SQL gt ALTER SESSION SET NLS_LANGUAGE french This message appears Session modifee. 5. At the SQL prompt, enter the query in Example 8-11. 6. The result of the query returns the error message in the language specified in Step 4. c- C WINDOWS system32 cmd.exe - sqlplus hr hr flSD SQL gt select from managers select from managers ORfl-00942 Table ou uue inexistante





