'Declaration Public Overloads Shadows Function ExecuteReader() As PgSqlDataReader
public new PgSqlDataReader ExecuteReader()
Return Value
A PgSqlDataReader object.
'Declaration Public Overloads Shadows Function ExecuteReader() As PgSqlDataReader
public new PgSqlDataReader ExecuteReader()
When FetchAll property is false the following restriction takes place. While the PgSqlDataReader is in use, the associated PgSqlConnection is busy serving the PgSqlDataReader. While in this state, no operations can be performed on the PgSqlConnection except closing. This is the case until the Close method of the PgSqlDataReader is called.
public void CreatePgSqlDataReader(string mySelectQuery,string pgConnectionString) { PgSqlConnection pgConnection = new PgSqlConnection(pgConnectionString); PgSqlCommand pgCommand = new PgSqlCommand(mySelectQuery, pgConnection); pgCommand.Connection.Open(); PgSqlDataReader pgReader = pgCommand.ExecuteReader(); try { while(pgReader.Read()) { Console.WriteLine(pgReader.GetString(0)); } } finally { pgReader.Close(); pgConnection.Close(); } }
Public Sub CreatePgSqlDataReader(mySelectQuery As String, _ pgConnectionString As String) Dim pgConnection As New PgSqlConnection(pgConnectionString) Dim pgCommand As New PgSqlCommand(mySelectQuery, pgConnection) pgCommand.Connection.Open() Dim pgReader As PgSqlDataReader = pgCommand.ExecuteReader() Try While pgReader.Read() Console.WriteLine(pgReader.GetString(0)) End While Finally pgReader.Close() pgConnection.Close() End Try End Sub
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2