troubleshooting Question

C# VS2010 array passing to a calling method

Avatar of cyimxtck
cyimxtckFlag for United States of America asked on
.NET ProgrammingC#
5 Comments1 Solution383 ViewsLast Modified:
The below code seems really straight forward but the method providing the stored procedure array of parameters (ArrayParm) isn't being read correctly by the calling method(rbInsert_Click)

        private void rbInsert_Click(object sender, RoutedEventArgs e)
        {
            String conn = Connections.BaseConnection;
            DatabaseFunction.ExecuteStoredProcInsert(conn, OracleObjects.InsertConnection, ArrayParm());  // it is telling me that the ArrayParm() is an invalid argument.
        }

// the above method uses a connection, a procedure name and the array of procedure //parameters but I cannot see to get it to call the other method (won't compile)

        public StoredProcParameter[] ArrayParm()  // <-- no problems here, it all seems good
        {
            StoredProcParameter[] oPL = new StoredProcParameter[6];

            oPL[0] = DatabaseFunction.CreateParameter("i_DBName", tbxDBName.Text, OracleDbType.Varchar2);
            oPL[1] = DatabaseFunction.CreateParameter("i_DBType", cboDBType.SelectedItem, OracleDbType.Varchar2);
            oPL[2] = DatabaseFunction.CreateParameter("i_UserName", tbxUID.Text, OracleDbType.Varchar2);
            oPL[3] = DatabaseFunction.CreateParameter("i_PWD", tbxDBName.Text, OracleDbType.Varchar2);
            oPL[4] = DatabaseFunction.CreateParameter("i_INSTANCE", cboInstance.SelectedItem , OracleDbType.Varchar2);
            oPL[5] = DatabaseFunction.CreateParameter("i_MAIN", tbxMain.Text, OracleDbType.Varchar2);
           
            return oPL;
        }

Any thoughts would be greatly appreciated.

Thanks,

B
ASKER CERTIFIED SOLUTION
Kyle Abrahams
Director of Information Technology

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros