public void ReadMyData(string myConnString)
{
string mySelectQuery = "SELECT AccountID, \"Account Name\" FROM Accounts";
ZohoBooksConnection ZohoBooksConnection = new ZohoBooksConnection(myConnString);
ZohoBooksCommand ZohoBooksCommand = new ZohoBooksCommand(mySelectQuery,ZohoBooksConnection);
ZohoBooksConnection.Open();
ZohoBooksDataReader ZohoBooksReader = ZohoBooksCommand.ExecuteReader();
try
{
while (ZohoBooksReader.Read())
{
Console.WriteLine(ZohoBooksReader.GetString(0) + ", " + ZohoBooksReader.GetString(1));
}
}
finally
{
// always call Close when done reading.
ZohoBooksReader.Close();
// always call Close when done reading.
ZohoBooksConnection.Close();
}
}