J
Jet
Hi all,
I had a code like the follow:
class A{
...
public void get(int i,params OleDbParameter[] p)
{
if((p!=null)||(p.Length>0))
{
// Do some work
}
else
{
// Do another work
}
}
....
}
And in other class I had create the instance which include this method , and
I had not the OleDbParameter[] parameter tranfer to this method.And I try to
do it like this to call the method:
....
A _a=new A();
int i=100;
_a.get(i,(OleDbParameter[])null);
....
But when it run to the method it throw me a "NullRefranceException"
How can I solve this problem? Why I can't give it the null value as the
parameter tranfer to the get() method? I also declare the null value as the
type OleDbParameter[].
I had a code like the follow:
class A{
...
public void get(int i,params OleDbParameter[] p)
{
if((p!=null)||(p.Length>0))
{
// Do some work
}
else
{
// Do another work
}
}
....
}
And in other class I had create the instance which include this method , and
I had not the OleDbParameter[] parameter tranfer to this method.And I try to
do it like this to call the method:
....
A _a=new A();
int i=100;
_a.get(i,(OleDbParameter[])null);
....
But when it run to the method it throw me a "NullRefranceException"
How can I solve this problem? Why I can't give it the null value as the
parameter tranfer to the get() method? I also declare the null value as the
type OleDbParameter[].