Object reference not set when running tablevalue function

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
Ariwibawa
Posts: 12
Joined: Sun 16 Aug 2009 14:18
Location: Indonesia
Contact:

Object reference not set when running tablevalue function

Post by 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

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Mon 16 Nov 2009 17:28

Thank you for the report, we have already fixed the problem.
Look forward to the next build.

Post Reply