Code: Select all
CREATE TABLE test
(
id serial NOT NULL,
name character varying(200) NOT NULL,
data date NOT NULL,
present boolean NOT NULL DEFAULT false,
CONSTRAINT test_pkey PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);
ALTER TABLE test
OWNER TO postgres;
Code: Select all
SELECT id, "name", "data", present FROM "public".test
Click the TableAdapter - Add Query - Use SQL statements - Select which returns a single value - Next -
Code: Select all
SELECT present FROM test where id=:id
Now I can do:
Code: Select all
var taAdapter = new testTableAdapter();
var valueTest1 = taAdapter.GetPresent(2).GetValueOrDefault();
//GetPresent(2) returns ?bool
Now, if I go to the TableAdapter and reconfigure the SQL statement without modifying anything the GetPresent(2) returns object and thus I can't use GetValueOrDefault();
Am I doing something wrong or is this a little bug?
Thanks.