Is dblink supported on CoreLab.PostgreSql(or Data).dll?

Is dblink supported on CoreLab.PostgreSql(or Data).dll?

Postby albyu2 » Mon 09 Feb 2009 11:07

Hi everybody!
I download and licenced this drivers "pgsqlnet375std2.exe" for .NET.
I made a complete installation and I'm referencing this 2 dll in my project:
- CoreLab.Data;
- CoreLab.PostreSql

I need to execute an UPDATE from the Database A to DataBase B. I do this command with DBLINK on PgAdmin and everything works!
I can't do this in .NET C#, here is the code:
Code: Select all
CoreLab.PostgreSql.PgSqlTransaction tran = this.Adapter.InsertCommand.Connection.BeginTransaction();

cmdText = "SELECT dblink_exec(, 'UPDATE schemaX.tabY SET id = {0} WHERE objectid = {1}')";
cmdText = string.Format(cmdText, myVar1, myVar2);

command =
   new CoreLab.PostgreSql.PgSqlCommand(
   cmdText, tran.Connection, tran);



this generate an Exception on 'command.ExecuteNonQuery();', which is:

Code: Select all
Message: function dblink_exec(text, unknown) does not exist
ErrorCode: 42883
FileName: .\src\backend\parser\parse_func.c
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
ProcedureName: ParseFuncOrColumn
Source: CoreLab.PostgreSql
StackTrace:   in CoreLab.PostgreSql.a.d(Boolean A_0)
   in CoreLab.PostgreSql.a.b(String A_0)
   in CoreLab.PostgreSql.a.l()
   in CoreLab.PostgreSql.PgSqlCommand.a(Boolean A_0, Int32 A_1, Int32 A_2)
   in CoreLab.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior)
   in System.Data.Common.DbCommand.ExecuteReader()
   in CoreLab.Common.DbCommandBase.ExecuteNonQuery()
   in It.Pit4.Sim.DGis.Common.DataSetImpresaTableAdapters.impresaTableAdapter.InsertImpresa(Int32 GIdImpresa) in C:\sim\sim\src\client\SimGui\Common\DataSetImpresa.cs:riga 185

Please, can anyone help me to solve this??? :roll:
Thank you so much! :wink:
Posts: 2
Joined: Mon 09 Feb 2009 10:33

Postby Shalex » Tue 10 Feb 2009 09:15

dotConnect for PostgreSQL works with the functions of the DBLink package normally. The error you are getting says that your PostgreSQL server doesn't have the dblink.dll module built in. Please make sure that this query with the same database works normally via PgAdmin. Refer to the PostgreSQL documentation to find out how to make dblink.dll work.

Please notify us about the results.
Devart Team
Posts: 7659
Joined: Thu 14 Aug 2008 12:44

Postby albyu2 » Mon 16 Feb 2009 08:38

As I said in my first message, this query works via PgAdmin!
Should I add the dblink.dll to my project? Where is this dll?

NB: in \PostgreSQL\8.3\lib there is the dblink.dll and it works in PgAdmin, I can't add it to my project.
Posts: 2
Joined: Mon 09 Feb 2009 10:33

Return to dotConnect for PostgreSQL