示例#1
0
        public void run()
        {
            Exception         exp       = null;
            string            selectSQL = "SELECT * FROM Employees WHERE EmployeeId = ? AND FirstName = ?";
            OracleDataAdapter oleDBda   = new OracleDataAdapter();

            oleDBda.SelectCommand = new OracleCommand(selectSQL, new OracleConnection());

            IDataParameter[] Idp = oleDBda.GetFillParameters();

            try
            {
                BeginCase("Length");
                Compare(Idp.Length, 0);
            }
            catch (Exception ex)     { exp = ex; }
            finally { EndCase(exp); exp = null; }


            oleDBda.SelectCommand.Parameters.Add(new OracleParameter("@EmployeeId", DbType.Int32));
            oleDBda.SelectCommand.Parameters["@EmployeeId"].SourceColumn = "EmployeeId";
            oleDBda.SelectCommand.Parameters.Add(new OracleParameter("@FirstName", OracleType.VarChar, 10));

            Idp = oleDBda.GetFillParameters();

            try
            {
                BeginCase("Parameter 0");
                Compare(Idp[0], oleDBda.SelectCommand.Parameters[0]);
            }
            catch (Exception ex)     { exp = ex; }
            finally { EndCase(exp); exp = null; }

            try
            {
                BeginCase("Parameter 1");
                Compare(Idp[1], oleDBda.SelectCommand.Parameters[1]);
            }
            catch (Exception ex)     { exp = ex; }
            finally { EndCase(exp); exp = null; }
        }
示例#2
0
 public IDataParameter[] GetFillParameters()
 {
     return(m_adapter.GetFillParameters());
 }