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);
command.ExecuteNonQuery();
tran.Commit();
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.ae()
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
Thank you so much!
A.