PROCEDURE "GET_ALL_AREA"
(
ITEMS_CURSOR OUT SYS_REFCURSOR
)
is
BEGIN
OPEN ITEMS_CURSOR FOR SELECT AREAID,AREANAME,AREAPINCODE FROM AREA;
END;
DataSet ds = new DataSet();
OracleCommand command = new OracleCommand();
command.CommandType = CommandType.StoredProcedure;
command.CommandText = “Get_All_Area”;
command.Connection = conn.Get_Connection();
command.Parameters.Add("ITEMS_CURSOR", OracleType.Cursor ).Direction = ParameterDirection.Output;
OracleDataAdapter adpt = new OracleDataAdapter(Command);
adpt.Fill(ds, str_table);
Close_Connection();
public string Connection_String
{
get
{
return ConfigurationSettings.AppSettings["dbConnectionString"];
}
}
//Function For Open New Connection
public OracleConnection Get_Connection()
{
try
{
OracleConn = new OracleConnection(Connection_String);
OracleConn.Open();
}
catch (Exception ex)
{
throw ex;
}
return OracleConn;
}
//Close Connection
public void Close_Connection()
{
try
{
OracleConn.Close();
}
catch(Exception ex)
{
throw new Exception(ex.Message, ex);
}
}
No comments:
Post a Comment