Hi there. I have 2 functions that are supposed to be complimenting each other but I cant seem to get it working. Basically I have a datahelper module that returns datasets. Its parameters are the name of the SP to run and the SQLParameterCollection to hold its parameters. One of my functions basically isnt working when trying to create the parametercollection. The code I am using is as follows...
Public Function ReturnUser(ByVal guidContactID As Guid) As ArkUser
Dim objTmpArk As ArkUser
'Another Custom class
Dim objDataHelper As New DataHelper
'Create the collection
Dim pParamArray As SqlParameterCollection
Dim objTmpReader As SqlDataReader
'Add to the parameter array?
pParamArray.Add(New SqlParameter("@ContID", SqlDbType.UniqueIdentifier).Value = guidContactID)
objTmpReader = objDataHelper.ReturnDataReader("sp_ContactID", pParamArray)
Howeever I cant seem to get the loading as I get the error "Object reference no set to an instance of an object" error on the line pParamarray.Add...
Anyone shed some light on this?