Return Value
true if there are more rows; otherwise, false.
While the SqlShimDataReader is in use, the associated Devart.Data.Magento.MagentoConnection is busy serving it until you call Close.
public void ReadMyData(string myConnString) { string mySelectQuery = "SELECT customer_id, lastname FROM Customers"; MagentoConnection magentoConnection = new MagentoConnection(myConnString); MagentoCommand magentoCommand = new MagentoCommand(mySelectQuery,magentoConnection); magentoConnection.Open(); MagentoDataReader magentoReader; magentoReader = magentoCommand.ExecuteReader(); // Always call Read before accessing data. while (magentoReader.Read()) { Console.WriteLine(magentoReader.GetString(0) + ", " + magentoReader.GetString(1)); } // always call Close when done reading. magentoReader.Close(); // Close the connection when done with it. magentoConnection.Close(); }
Public Sub ReadMyData(myConnString As String) Dim mySelectQuery As String = "SELECT customer_id, lastname FROM Customers" Dim magentoConnection As New MagentoConnection(myConnString) Dim magentoCommand As New MagentoCommand(mySelectQuery, magentoConnection) magentoConnection.Open() Dim magentoReader As MagentoDataReader magentoReader = magentoCommand.ExecuteReader() ' Always call Read before accessing data. While magentoReader.Read() Console.WriteLine(magentoReader.GetString(0) + ", " _ + magentoReader.GetString(1)) End While ' always call Close when done reading. magentoReader.Close() ' Close the connection when done with it. magentoConnection.Close() End Sub
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