error syntax NET

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
Posts: 5
Joined: Thu 24 Nov 2005 14:16

error syntax NET

Post by felmarla » Mon 05 Dec 2005 14:47

As it is the syntax of the handling of execution of cursors in NET since it leaves syntax error to me surrounds to all and I have asi.
pgcoman.CommandText=("fetch all in \"ref\"");

Devart Team
Posts: 133
Joined: Thu 08 Sep 2005 06:27

Post by SecureGen » Mon 05 Dec 2005 15:17

Such code works ok in my tests. Please make sure that you open and fetch cursor in the same transaction.

PgSqlCommand cursorCmd = new PgSqlCommand("fetch all in \"dept\"", pgSqlConnection);
// need to start transaction, because cursor is acessible only in transaction
PgSqlTransaction tr = pgSqlConnection.BeginTransaction();
try {
// Opens named cursor

// fetch data from named cursor
PgSqlDataReader dataReader = cursorCmd.ExecuteReader();

while (dataReader.Read()) {
object obj = dataReader.GetValue(0);


// commit transaction

Post Reply