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