Read Method (SqlShimDataReader)
|
|---|
'Declaration
Public Overrides Function Read() As Boolean |
|
|---|
public override bool Read() |
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 |