ExecuteReader(CommandBehavior) Method
The following example creates a
ZohoCommand, then executes it by passing a string that is SQL SELECT statement, and a string to use to connect to the data source. The
System.Data.CommandBehavior is then set to CloseConnection.
public void CreateZohoDataReader(string mySelectQuery,string zohoConnectionString)
{
ZohoConnection zohoConnection = new ZohoConnection(zohoConnectionString);
ZohoCommand zohoCommand = new ZohoCommand(mySelectQuery, zohoConnection);
zohoCommand.Connection.Open();
ZohoDataReader zohoReader = zohoCommand.ExecuteReader(CommandBehavior.CloseConnection);
while(zohoReader.Read())
{
Console.WriteLine(zohoReader.GetString(0));
}
zohoReader.Close();
}
Public Sub CreateZohoDataReader(mySelectQuery As String, _
zohoConnectionString As String)
Dim zohoConnection As New ZohoConnection(zohoConnectionString)
Dim zohoCommand As New ZohoCommand(mySelectQuery, zohoConnection)
zohoCommand.Connection.Open()
Dim zohoReader As ZohoDataReader = zohoCommand.ExecuteReader(CommandBehavior.CloseConnection)
While zohoReader.Read()
Console.WriteLine(zohoReader.GetString(0))
End While
zohoReader.Close()
End Sub