Object reference not set when running tablevalue function
Posted: 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.
Thanks & Regards,
Ariwibawa
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
Ariwibawa