Are arguments passed to a function contained in an array object?

  • Thread starter Gabriel Lozano-Morán
  • Start date
G

Gabriel Lozano-Morán

I want to pass to the CreateInstance method the arguments that were passed
to the CreateParameter method without creating an array list first.

public IDataParameter CreateParameter(string parameterName, DbType dbType,
int size)
{
...
parameter =
(IDataParameter)Activator.CreateInstance(this._parameterType[(int)this.ProviderType],
__argList);
...

}

Gabriel Lozano-Morán
 
G

Gabriel Lozano-Morán

I believe I have found an answer to my question. Please correct me if there
is a better approach.

To retrieve the parameters passed to the function I do the following:
System.Reflection.MethodBase.GetCurrentMethod().GetParameters()

Gabriel Lozano-Morán
 
M

Mattias Sjögren

To retrieve the parameters passed to the function I do the following:
System.Reflection.MethodBase.GetCurrentMethod().GetParameters()

That gets you reflection info about the formal parameters
(ParameterInfo) but not the actual argument values passed to the
method.


Why don't you want to create an array?



Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top