VistaDB 5
Example 






ExecuteReader() Method
Executes the CommandText against the Connection, and returns an VistaDBDataReader.
Syntax
'Declaration
 
Public Overloads Shadows Function ExecuteReader() As VistaDBDataReader
'Usage
 
Dim instance As VistaDBCommand
Dim value As VistaDBDataReader
 
value = instance.ExecuteReader()
public new VistaDBDataReader ExecuteReader()
public function ExecuteReader(): VistaDBDataReader; 
public hide function ExecuteReader() : VistaDBDataReader;
public: new VistaDBDataReader* ExecuteReader(); 
public:
new VistaDBDataReader^ ExecuteReader(); 

Return Value

A VistaDBDataReader object.
Example
The following example creates a VistaDBCommand, and then executes it.
public void Execute(VistaDBCommand command)
{
	try
	{
		command.Connection.Open();
		using(VistaDBDataReader reader = command.ExecuteReader())
		{
			while(reader.Read())
			{
				Console.WriteLine("{0}", reader[0]);
			}
		}
	}
	finally
	{
		command.Connection.Close();
	}
}
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