How can I keep an OdbcDataAdapter from using fully qualified tble names?

From: Rob Richardson <interrobang(at)yahoo(dot)com>
To: pgsql-odbc(at)postgresql(dot)org
Subject: How can I keep an OdbcDataAdapter from using fully qualified tble names?
Date: 2012-04-25 14:05:50
Message-ID: 1335362750.25657.YahooMailRC@web83604.mail.sp1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

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

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Barry Bell 2012-04-25 14:11:58 Re: How can I keep an OdbcDataAdapter from using fully qualified tble names?
Previous Message Jan-Peter Seifert 2012-04-23 11:21:59 Advanced Options - OID