Skip to content
This repository has been archived by the owner on Jan 29, 2019. It is now read-only.
flq edited this page May 11, 2011 · 5 revisions

Use System.Data.OracleProvider

The provider contained in the .NET framework is practically not maintained anymore, in fact in .NET 4.0 it is already marked as obsolete. Use the one provided by Oracle.

Specialities of the Simple.Data.Oracle provider

Calling procedures of packages

In this situation, use a double-underscore to separate the package name from the procedure name:

var result = _db.Department__Department_Count();

Usage of Sequences

When inserting use the Sequence.Next("Seq_name") or Sequence.Current("Seq_name") in your insert statement, e.g.

using (var tx = _db.BeginTransaction())
{
    tx.Departments.Insert(
        DepartmentId: Sequence.Next("DEPARTMENTS_SEQ"),
        DepartmentName: "Sky",
        ManagerId: 100,
        LocationId: 1000);
    tx.Employees.Insert(
        EmployeeId: Sequence.Next("EMPLOYEES_SEQ"), 
        LastName: "Brannigan", 
        Email: "[email protected]", 
        HireDate: new DateTime(2011,1,1),
        JobId: "AD_ASST",
        DepartmentId: Sequence.Current("DEPARTMENTS_SEQ"));
    tx.Commit();
}