Hi,
I've got a project that uses a different database for production and test. I'm connecting via a Devart.Data.PostgreSql.PgSqlConnection. I've included code that changes the ConnectionString, Port, UserId, Host and Database properties prior to connecting. Outside of the Update function it seems like I am successfully connecting to the correct DB and I'm able to query data etc. However when I use Update I get an exception indicating that cross database queries are not supported. I looked around and found that in some of the auto-generated code in .Designer.vb actually has the name of the default database (that is filled out in the designer) hardcoded into the strings for the Update function (and others):
Me.PgSqlCommand11.CommandText = "INSERT INTO """.""""."""" ...
The above is my redaction of course, the actual code has the actual DB name right in the string. I've globally found the DBName and removed it and gotten the code to work, but I would like to avoid altering generated code. Is there any way to make the generated code DB name agnostic?
Thanks,
Greg
Hardcoded database name in generated code
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
We have released the new 5.0.69 version of dotConnect for PostgreSQL where these changes are available. The new build can be downloaded from
http://www.devart.com/dotconnect/postgr ... nload.html
(the trial version) or from Registered Users' Area (for users with active subscription only):
http://secure.devart.com/
For more information about the fixes and improvements available in dotConnect for PostgreSQL 5.0.69, please refer to
http://www.devart.com/forums/viewtopic.php?t=19795
http://www.devart.com/dotconnect/postgr ... nload.html
(the trial version) or from Registered Users' Area (for users with active subscription only):
http://secure.devart.com/
For more information about the fixes and improvements available in dotConnect for PostgreSQL 5.0.69, please refer to
http://www.devart.com/forums/viewtopic.php?t=19795