ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Code Snippets  >>  Programming Code  >>  Programming Code AllOther
 
 


 

 
 C Code interview questions  C Code Interview Questions
 C++ Code interview questions  C++ Code Interview Questions
 VC++ Code interview questions  VC++ Code Interview Questions
 Java Code interview questions  Java Code Interview Questions
 Dot Net Code interview questions  Dot Net Code Interview Questions
 Visual Basic Code interview questions  Visual Basic Code Interview Questions
 Programming Code AllOther interview questions  Programming Code AllOther Interview Questions
Question
DAL in oracle
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: DAL in oracle
Answer
# 1

        public List<EEmployeeDetails> GetDetails(int 
intEmpId,  DateTime fromDate, DateTime toDate, int 
intPageNo, int intPageSize, out int intTotalRecords, string 
strOrderBy)
        {
            List<EEmployeeDetails> ListDetails = new 
List<EEmployeeDetails>();
            intTotalRecords = 0;
            try
            {              
                using (OracleDataReader objReader = 
DataClient.ExecuteReader(ConnectionString, 
CommandType.StoredProcedure, PROCEDURE_GET, GetDetailParams
(intEmpId, intReconciledstatus, fromDate, toDate, 
intPageNo, intPageSize, strOrderBy)))
                {
                    while (objReader.Read())
                    {
                        EEmployeeDetails 
objEEmployeeDetails = new EEmployeeDetails();
                        if (!string.IsNullOrEmpty(objReader
["Employee_ID"].ToString()))
                        objEEmployeeDetails.EMPLOYEEId = 
Convert.ToInt32(objReader["Employee_ID"]);
                        if (!string.IsNullOrEmpty(objReader
["EMPLOYEE_NUMBER"].ToString()))
                        objEEmployeeDetails.EMPLOYEENumber 
= (string)(objReader["EMPLOYEE_NUMBER"]);
                        if (!string.IsNullOrEmpty(objReader
["EMPLOYEE_DATE"].ToString()))                       
                        if (!string.IsNullOrEmpty(objReader
["AMOUNT"].ToString()))
                        objEEmployeeDetails.Amount = 
Convert.ToInt32(objReader["AMOUNT"]);
                        if (!string.IsNullOrEmpty(objReader
["TOTAL"].ToString()))
                            objEEmployeeDetails.Total = 
Convert.ToInt32(objReader
["TOTAL"]);                                              
                        
                        intTotalRecords = Convert.ToInt32
(objReader["TOTAL"]);

                        ListDetails.Add
(objEEmployeeDetails);
                    }
                }
                
            }
            catch (Exception ex)
            {
                bool rethrow = 
ExceptionPolicy.HandleException(ex, "Propagate Policy");
                if (rethrow)
                {
                    throw ex;
                }
            }
            return ListDetails;
        }

        

         ///<summary>
         ///helper class for get details
         ///         
         ///   </summary>
        public static OracleParameter[] GetDetailParams(int 
intEmpId,  DateTime fromDate, DateTime toDate, int 
intPageNo, int intPageSize, string strOrderBy)
        {
            OracleParameter[] sqlParams = null;
            try
            {
                sqlParams = DataClient.GetCachedParameterSet
(ConnectionString, PROCEDURE_GET);
                if (sqlParams == null || sqlParams.Length 
== 0)
                { 
                sqlParams = new OracleParameter[]
                {
                    new OracleParameter(PARAM_ID, 
OracleDbType.Int32),
                    new OracleParameter(PARAM_STATUS , 
OracleDbType.Int32),
                    new OracleParameter(PARAM_FROMDATE, 
OracleDbType.Date),
                    new OracleParameter(PARAM_TODATE, 
OracleDbType.Date),
                    new OracleParameter
(PARAM_RETURN,OracleDbType.Int32),
                    new OracleParameter(PARAM_REFCURSOR, 
OracleDbType.RefCursor),                  
                    new OracleParameter(PARAM_PAGENUM, 
OracleDbType.Int32),
                    new OracleParameter(PARAM_PAGESIZE, 
OracleDbType.Int32),
                    new OracleParameter (PARAM_TOTALCOUNT, 
OracleDbType.Int32),
                    new OracleParameter(PARAM_ORDERBY, 
OracleDbType.Char)    
                };
                DataClient.CacheParameterSet
(DataClient.CONN_STRING, PROCEDURE_GET, sqlParams);
               
                    sqlParams
[0].Direction=ParameterDirection.InputOutput;
                   sqlParams[0].Value = intEmpId;          
                   
                    sqlParams[2].Value = fromDate;
                    sqlParams[3].Value = 
toDate;                   
                    sqlParams
[4].Direction=ParameterDirection.Output;
                    sqlParams
[5].Direction=ParameterDirection.Output;                   
                    sqlParams[6].Value = intPageNo;
                    sqlParams[7].Value = intPageSize;
                    sqlParams[8].Direction = 
ParameterDirection.Output;
                    sqlParams[9].Value = strOrderBy;
                 }
            }
            catch (Exception ex)
            {
                var rethrow = 
ExceptionPolicy.HandleException(ex, "Propagate Policy");
                if (rethrow)
                {
                    throw ex;
                }
            }
            return sqlParams;
        }
 
Is This Answer Correct ?    0 Yes 0 No
Guest
 

 
 
 
Other Programming Code AllOther Interview Questions
 
  Question Asked @ Answers
 
i wrote from two tables (employee and department) 1.select * from employee,department; (it is cartesian product) but 2.select * from employee department; (?????????????????) by default it displays the employee table,what is the reason it is not taking department ??? mail @ mak2786@gmail.com Arunkumar  1
DAL in oracle  1
Write a sql query to find n'th maximum in the database table. Oracle3
 
For more Programming Code AllOther Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com