pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Richardson <interrobang@yahoo.com>
To: pgsql-odbc@postgresql.org
Subject: How can I keep an OdbcDataAdapter from using fully qualified tble names?
Date: Wed, 25 Apr 2012 07:05:50 -0700 (PDT)
Message-ID: <1335362750.25657.YahooMailRC@web83604.mail.sp1.yahoo.com> (raw)
In-Reply-To: <20120425135420.91A461E62E82@mail.postgresql.org>
References: <20120425135420.91A461E62E82@mail.postgresql.org>

Hello!

How can I keep an OdbcDataAdapter from insisting on the fully qualified table 
name?


In VS 2008, I am trying to use the System.Data.Odbc namespace to work with a 
PostGres database.  I don't want to use npgsql because I want to work with DSNs 
so that I get the flexibility of changing databases without changing my 
program.  


When I use an OdbcCommandBuilder object to create the insert, update and delete 
commands for me, the table names are fully qualified.  For example, an insert 
command might begin with "insert into MyDatabase.public.MyTable...".  When I try 
to use that, I get an exception thrown that complains that cross-database 
references are not implemented (even though the connection I am using is to the 
MyDatabase database).  


So, I wrote a little function that converts a string containing 
"MyDatabase.public.MyTable" into "MyTable", and use that to replace the fully 
qualified name in the command text with the bare table name.  But when it comes 
to time to call the adapter's Update() method to add a new row into my table, 
the first thing the adapter does is to change the bare table name back to the 
full "MyDatabase.public.MyTable" name, and then I get the same exception.

Thank you very much.

RobR




view thread (7+ messages)  latest in thread

Message-ID: <1335362750.25657.YahooMailRC@web83604.mail.sp1.yahoo.com>
Permalink:  ../1335362750.25657.YahooMailRC@web83604.mail.sp1.yahoo.com/
Also on:    postgresql.org/message-id/1335362750.25657.YahooMailRC@web83604.mail.sp1.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: interrobang@yahoo.com
  Subject: Re: How can I keep an OdbcDataAdapter from using fully qualified tble names?
  In-Reply-To: <1335362750.25657.YahooMailRC@web83604.mail.sp1.yahoo.com>
  References: <20120425135420.91A461E62E82@mail.postgresql.org> <1335362750.25657.YahooMailRC@web83604.mail.sp1.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox