RE: Passing Parameter Collections



Hi Vayse,

You're getting an "Object reference not set to an instance of an object."
because the paramsCustomer is only a reference which is not pointing to any
objects. Generally, when we're trying to create a new object reference
pointing to some valid objects, we use Dim a as New ClassA. This requires
the ClassA has a constructor. However, in this case, the class
OleDbParameter does not have a constructor, so we cannot create it without
the a Command.

If you already have a command object and need to assign a parameter
collection to it, just use oledbCommand.Parameters = Params

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

.



Relevant Pages

  • Re: I wonder why this question is never addressed
    ... When you pass an object using a ByVal parameter, a new object reference ... pointing it to a different object or to Nothing) will have no effect on the ... corresponding object reference in the calling procedure. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: May buil but woncompile..
    ... Unhandled Exception: System.NullReferenceException: Object reference not set to ... You created a pointer to a Month but it is uninitialized and not pointing at anything valid. ...
    (microsoft.public.vc.mfc)
  • Re: Delphi interfaces vs. COM interfaces
    ... > Or, in the place where you keep an object reference, call _AddRef. ... Thanks for pointing that out. ... Paul ...
    (borland.public.delphi.language.objectpascal)
  • Re: Initialization section
    ... fields to zero. ... a constructor must be invoked on a class ... ordinal type fields to become zero, the value of all pointer and class- ... When a constructor is invoked on an object reference, ...
    (comp.lang.pascal.delphi.misc)
  • Re: Initialization section
    ... fields to zero. ... a constructor must be invoked on a class ... ordinal type fields to become zero, the value of all pointer and class- ... When a constructor is invoked on an object reference, ...
    (comp.lang.pascal.delphi.misc)