Read Method (SqlShimDataReader)
public override bool Read()
'Declaration
Public Overrides Function Read() As Boolean
Return Value
true if there are more rows; otherwise, false.
The following example creates a
Devart.Data.MailChimp.MailChimpConnection, a
Devart.Data.MailChimp.MailChimpCommand, and a
SqlShimDataReader. The example reads through the data, writing it out to the console. Finally, the example closes the
SqlShimDataReader, then the
Devart.Data.MailChimp.MailChimpConnection.
public void ReadMyData(string myConnString)
{
string mySelectQuery = "SELECT Id, Name FROM Folders";
MailChimpConnection mailchimpConnection = new MailChimpConnection(myConnString);
MailChimpCommand mailchimpCommand = new MailChimpCommand(mySelectQuery,mailchimpConnection);
mailchimpConnection.Open();
MailChimpDataReader mailchimpReader;
mailchimpReader = mailchimpCommand.ExecuteReader();
// Always call Read before accessing data.
while (mailchimpReader.Read()) {
Console.WriteLine(mailchimpReader.GetString(0) + ", " + mailchimpReader.GetString(1));
}
// always call Close when done reading.
mailchimpReader.Close();
// Close the connection when done with it.
mailchimpConnection.Close();
}
Public Sub ReadMyData(myConnString As String)
Dim mySelectQuery As String = "SELECT Id, Name FROM Folders"
Dim mailchimpConnection As New MailChimpConnection(myConnString)
Dim mailchimpCommand As New MailChimpCommand(mySelectQuery, mailchimpConnection)
mailchimpConnection.Open()
Dim mailchimpReader As MailChimpDataReader
mailchimpReader = mailchimpCommand.ExecuteReader()
' Always call Read before accessing data.
While mailchimpReader.Read()
Console.WriteLine(mailchimpReader.GetString(0) + ", " _
+ mailchimpReader.GetString(1))
End While
' always call Close when done reading.
mailchimpReader.Close()
' Close the connection when done with it.
mailchimpConnection.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