public DataSet Bill_Point_No(string CUSTOMER_ID)//ok
{
DataSet dataset = new DataSet().
Hashtable HT=new Hashtable().
HT.Add("P_CUSTOMER_ID",CUSTOMER_ID).
if(RunProcedure("Re_CURSOR",OracleType.Cursor,ref dataset,
HT,bmsOracleUser ".YY_PKG_BILL_POINT_NO.BILL_POINT_NO",
bmsOracleConnectionString))
{
.
}
else
{
dataset=null.
}
return dataset.
}
public bool RunProcedure(string ReturnParameter,
OracleType ParamType,ref DataSet Dataset,Hashtable HT ,
string ProcedureName,string OracleConnection)
{
System.Data.OracleClient.OracleConnection dsconnection =
new System.Data.OracleClient.OracleConnection(OracleConnection).
System.Data.OracleClient.OracleCommand dacommand =
new System.Data.OracleClient.OracleCommand(ProcedureName,dsconnection).
dsconnection.Open().
dacommand.CommandType=CommandType.StoredProcedure.
IDictionaryEnumerator Enumerator.
Enumerator = HT.GetEnumerator().
object Value=null.
OracleParameter OracleParam.
OracleParam = dacommand.Parameters.
Add(new OracleParameter(ReturnParameter,ParamType)).
OracleParam.Direction = ParameterDirection.Output.
while(Enumerator.MoveNext())
{
Value = Enumerator.Value.
OracleParam=dacommand.Parameters.
Add(new OracleParameter
(Enumerator.Key.ToString(), Value)).
}
OracleDataAdapter ODAdapter=new OracleDataAdapter(dacommand).
try
{
ODAdapter.Fill(Dataset).
return true.
}
catch(System.Exception e)
{
e.ToString().
return false.
}
finally
{
HT.Clear().
dacommand.Parameters.Clear().
dsconnection.Close().
}
} |