PgSqlCommandBuilder - How to exclude database name?
Posted: Mon 11 Dec 2006 11:15
Hi,
I have a database called "Sample Database". MyConnectionStr is as follows :-
There is a simple table called "layout" in the "public" schema defined as follows :-
If I do this :-
The output is :-
UPDATE Sample Database.public.layout SET updatedby = :p1
Obviously that fails!!! How do I get PgSqlCommandBuilder to exclude the database name?
Thanks,
Hedley
I have a database called "Sample Database". MyConnectionStr is as follows :-
Code: Select all
User Id=user;Password=passwd;Host=localhost;Port=5432;Database="Sample Database";Unicode=True;Schema=public;
Code: Select all
CREATE TABLE public.layout (
id int8 NOT NULL,
section varchar(30) NOT NULL,
name varchar(120) NOT NULL,
staff_id int8,
data bytea,
CONSTRAINT layout_pkey PRIMARY KEY(id)
)
WITHOUT OIDS;
Code: Select all
PgSqlDataAdapter adap = new PgSqlDataAdapter("select * from layout", MyConnectionStr);
PgSqlCommandBuilder cb = new PgSqlCommandBuilder(adap);
Console.WriteLine(cb.GetUpdateCommand().CommandText);
UPDATE Sample Database.public.layout SET updatedby = :p1
Obviously that fails!!! How do I get PgSqlCommandBuilder to exclude the database name?
Thanks,
Hedley