Add a class using Website->Add New Item. Select Class
as the template and enter the PayrollDAL as the name
of the class. The class is automatically placed in App_Code folder of the website. Type the following code in PayrollDAL.cs.
using System;
using System.Data;
using System.Data.OracleClient; // required for oracle
public class PayrollDAL
{
public DataTable GetJobs()
{
// using HR account of Oracle10g.
OracleConnection con = new OracleConnection("uid=hr;pwd=hr;server=localhost");
OracleDataAdapter da = new OracleDataAdapter("select * from jobs", con);
DataSet ds = new DataSet();
da.Fill(ds, "jobs");
return ds.Tables["jobs"]; // return a DataTable from DataSet
}
}