VistaDB 5
Example 






VistaDB.Provider Namespace > VistaDBCommand Class > ExecuteReader Method : ExecuteReader(CommandBehavior) Method
One of the CommandBehavior values.
ExecuteReader(CommandBehavior) Method
Executes the CommandText against the Connection, and returns an VistaDBDataReader using one of the CommandBehavior values.
Syntax
'Declaration
 
Public Overloads Shadows Function ExecuteReader( _
   ByVal behavior As System.Data.CommandBehavior _
) As VistaDBDataReader
'Usage
 
Dim instance As VistaDBCommand
Dim behavior As System.Data.CommandBehavior
Dim value As VistaDBDataReader
 
value = instance.ExecuteReader(behavior)
public new VistaDBDataReader ExecuteReader( 
   System.Data.CommandBehavior behavior
)
public function ExecuteReader( 
    behavior: System.Data.CommandBehavior
): VistaDBDataReader; 
public hide function ExecuteReader( 
   behavior : System.Data.CommandBehavior
) : VistaDBDataReader;
public: new VistaDBDataReader* ExecuteReader( 
   System.Data.CommandBehavior behavior
) 
public:
new VistaDBDataReader^ ExecuteReader( 
   System.Data.CommandBehavior behavior
) 

Parameters

behavior
One of the CommandBehavior values.

Return Value

A VistaDBDataReader object.
Example
The following example creates a VistaDBCommand, and then executes it.
public void Execute(VistaDBCommand command)
{
	command.Connection.Open();
            
	using(VistaDBDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection))
	{
		while(reader.Read())
		{
			Console.WriteLine("{0}", reader[0]);
		}
	}
}
Requirements

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

See Also