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?

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
grouppgsql-novice @
categoriespostgresql
postedFeb 21, '07 at 6:21p
activeFeb 21, '07 at 6:21p
posts1
users1
websitepostgresql.org
irc#postgresql

1 user in discussion

Allan Sullivan: 1 post

People

Translate

site design / logo © 2022 Grokbase