|
|
|
- ODP.NET - Fundamental ODP.NET Classes to Retrieve Data
To retrieve data from an Oracle database using ODP.NET, we need to work with a few of the ODP.NET classes. At this point, we will discuss the most fundamental classes available in ODP.NET for retrieving data.
|
|
|
|
|
|
- ODP.NET - Retrieving Data Using OracleDataReader
OracleDataReader is simply a read-only and forward-only result set. It works only if the database connection is open and it makes sure that the connection is open while you are retrieving data. As the data that it retrieves is read-only, it is a bit...
|
|
|
|
|
|
- ODP.NET - Retrieving Multiple Rows on to the Grid
In the previous section, we tried to retrieve only one row using OracleDataReader. In this section, we will try to retrieve more than one row (or a result set) and populate a DataGridView on a WinForm.
|
|
|
|
|
|
- ODP.NET - Retrieving Typed Data
While retrieving values from OracleDataReader, we can extract information available in individual columns (of a particular row) either by using column ordinal (position) values or column names.
|
|
|
|
|
|
- ODP.NET - Filling a DataTable Using OracleDataReader
So far, we have been filling data tables using OracleDataAdapter. ADO.NET 2.0 gives us the flexibility to fill a data table using OracleDataReader as well. The following code gives you the details of all employees available in the emp table by f...
|
|
|
|
|
|
- ODP.NET - Retrieving a Single Row of Information Using OracleDataAdapter
In the previous example, we worked with a set of rows in the DataTable object. Now, we shall work with a particular row using the DataTable object. The following code accepts an employee number from the user and gives you the...
|
|
|
|
|
|
- ODP.NET - Working with DataTableReader
DataTableReader is complementary to a DataTable object, and is mainly used as a type of Data Reader in the disconnected mode. The following is the modified code:
|
|
|
|
|
|
- ODP.NET - Populating a Dataset with a Single Data Table
A dataset is simply a group of data tables. These data tables can be identified with their own unique names within a dataset. You can also add relations between data tables available in a dataset.
|
|
|
|
|
|
- ODP.NET - Populating a Dataset with Multiple Data Tables
Now, let us add more than one data table into a dataset The following code retrieves a list of department details into a data table named Departments and another list of employee details into a data table named Employees:
|
|
|
|
|
|
- ODP.NET - Presenting Master-Detail Information Using a Dataset
As mentioned before, a DataSet object can have its own relations between data tables existing in it. We can add these relations dynamically at the client side (within an application), to represent master-detail (or hierarchical) inform...
|
|
|
|
|
|
-
ODP.NET - More About the OracleCommand Object
Till now, we have seen OracleCommand working with OracleDataReader. OracleCommand is not simply meant for OracleDataReader. It has got a lot of functionality for itself. Let us see few of the most commonly used features of OracleCommand in this sect...
|
|
|
|
|
|
- ODP.NET - Handling Nulls when Executing with ExecuteScalar
The most important issue to remember is that ExecuteScalar simply returns an object type of data. The object refers to any data type within .NET. If the data type of your variable matches with the type of object returned by ExecuteScalar, ...
|
|
|
|
|
|
- ODP.NET - Handling Nulls when Working with OracleDataReader
When we work with OracleDataReader (or for that matter, even with data rows in a data table), we may come across nulls. The following is the efficient way to deal in with such scenarios:
|
|
|
|
|
|
- ODP.NET - Working with Bind Variables together with OracleParameter
With the help of OracleParameter, you can include bind variables within any SQL statement. These bind variables are nothing but run-time query parameters. The values in the SQL statement are bound at run time when we use bind vari...
|
|
|
|
|
|
- ODP.NET - Working with OracleDataAdapter together with OracleCommand
In the previous examples, we worked with OracleDataAdapter by directly specifying SQL statements. You can also pass OracleCommand to OracleDataAdapter. This is very useful if you deal with stored procedures (covered in Chapter 5)...
|
|
|
|
|
|
- ODP.NET - Techniques to Improve Performance while Retrieving Data
Performance tuning is a great subject in Oracle. Volumes of books would not be enough to cover every aspect of performance tuning in Oracle. However, in this section, we will only discuss the fundamental performance techniques while ...
|
|
|