dotConnect for Salesforce Marketing Cloud Documentation
Devart.Data.ExactTarget Namespace / ExactTargetCommand Class / ExecuteReader Method / ExecuteReader() Method
Example

ExecuteReader() Method
Sends the CommandText to the Connection and builds a ExactTargetDataReader.
Syntax
'Declaration
 
Public Overloads Shadows Function ExecuteReader() As ExactTargetDataReader
 

Return Value

Example
The following example creates a ExactTargetCommand, then executes it by passing a string that is SQL SELECT statement, and a string to use to connect to the data source.
public void CreateExactTargetDataReader(string mySelectQuery,string exactTargetConnectionString)
{
  ExactTargetConnection exactTargetConnection = new ExactTargetConnection(exactTargetConnectionString);
  ExactTargetCommand exactTargetCommand = new ExactTargetCommand(mySelectQuery, exactTargetConnection);
  exactTargetCommand.Connection.Open();
  ExactTargetDataReader exactTargetReader = exactTargetCommand.ExecuteReader();
  try
  {
    while(exactTargetReader.Read())
    {
      Console.WriteLine(exactTargetReader.GetString(0));
    }
  }
  finally
  {
    exactTargetReader.Close();
    exactTargetConnection.Close();
  }
}
Public Sub CreateExactTargetDataReader(mySelectQuery As String, _
exactTargetConnectionString As String)
  Dim exactTargetConnection As New ExactTargetConnection(exactTargetConnectionString)
  Dim exactTargetCommand As New ExactTargetCommand(mySelectQuery, exactTargetConnection)
  exactTargetCommand.Connection.Open()
  Dim exactTargetReader As ExactTargetDataReader = exactTargetCommand.ExecuteReader()
  Try
    While exactTargetReader.Read()
      Console.WriteLine(exactTargetReader.GetString(0))
    End While
  Finally
    exactTargetReader.Close()
    exactTargetConnection.Close()
  End Try
End Sub
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