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