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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

"Stream does not support Writing" exception




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?






Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group