Object reference not set when running tablevalue function

Object reference not set when running tablevalue function

Postby Ariwibawa » Sun 15 Nov 2009 16:17

Dear Devart,

I've another problem with function, this time tablevalue function that returns setof custom data type in postgresql. The error message returned was "Object reference not set to an instance of an object.". I've succesfully executed this function in pgadmin.

Code: Select all
CREATE TABLE cachesession
(
  cachename character varying(30) NOT NULL,
  createdtime timestamp without time zone NOT NULL,
  createdfor character varying(20) NOT NULL,
  cachedata text,
  cachetype character varying(200) NOT NULL,
  CONSTRAINT "pk_CacheName" PRIMARY KEY (cachename, createdfor)
)
WITHOUT OIDS;
ALTER TABLE cachesession OWNER TO postgres;

CREATE TYPE cachemanager_type AS
   (cachetype character varying(200),
    cachedata text);
ALTER TYPE cachemanager_type OWNER TO postgres;

CREATE OR REPLACE FUNCTION cachemanagerget(cachename character varying, createdfor character varying)
  RETURNS SETOF cachemanager_type AS
'select cachetype, cachedata from cachesession where cachename = $1 and createdfor = $2;'
  LANGUAGE 'sql' VOLATILE;
ALTER FUNCTION cachemanagerget(cachename character varying, createdfor character varying) OWNER TO postgres;


Code: Select all
Using db As New ITTOSWEBDataContex (CommonFunction.ConnectionStringDefault)
    Dim data As CachemanagergetResult = db.Cachemanagerget(name, LoginUser.Userid).SingleOrDefault
     If data IsNot Nothing Then
          ...
     End If
End Using


Thanks & Regards,
Ariwibawa
Ariwibawa
 
Posts: 12
Joined: Sun 16 Aug 2009 14:18
Location: Indonesia

Postby AndreyR » Mon 16 Nov 2009 17:28

Thank you for the report, we have already fixed the problem.
Look forward to the next build.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16


Return to dotConnect for PostgreSQL