Skip site navigation (1) Skip section navigation (2)

"Stream does not support Writing" exception

From: "Allan Sullivan" <allan(dot)sullivan(at)nortak(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: "Stream does not support Writing" exception
Date: 2007-02-21 18:07:51
Message-ID: 3D9BF154E1B04444B6D07D04B1F0CD4F4EF7C9@ntk-mail2k3.nortak.com (view raw or flat)
Thread:
Lists: pgsql-novice

Ran into a strange problem that seems to appear randomly, and I haven't been able to pin down the conditions under which it appears.

I have 2 functions that I use to access my database. These functions are called from multiple locations. In one of the functions, I have the following code:
	Dim sql as string = "select ..... "

	Dim conn As New Npgsql.NpgsqlConnection(ConnectionString)
        conn.Open()

        Dim command = New Npgsql.NpgsqlCommand(sql, conn)

        Try
            Dim dr As Npgsql.NpgsqlDataReader = command.ExecuteReader()
            
	    ' perform processing 

            dr.Close()
            conn.Close()
        catch ex As Exception
        ....
For some reason, an exception "Stream does not support Writing" is being thrown on the ExecuteReader command. However, it does not occur all the time (nor does it always appear when the same function is calling it.

Did a quick search and didn't find any reference to this error with Postgres. Any idea what the cause could be?




pgsql-novice by date

Next:From: Vishal MailinglistDate: 2007-02-21 18:36:22
Subject: VB.net and PostgreSQL readiness
Previous:From: NabilDate: 2007-02-21 17:42:05
Subject:

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group