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.Magento.MagentoConnection, a
Devart.Data.Magento.MagentoCommand, 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.Magento.MagentoConnection.
|
|---|
public void ReadMyData(string myConnString)
{
string mySelectQuery = "SELECT customer_id, lastname FROM Customers";
MagentoConnection adobe commerceConnection = new MagentoConnection(myConnString);
MagentoCommand adobe commerceCommand = new MagentoCommand(mySelectQuery,adobe commerceConnection);
adobe commerceConnection.Open();
MagentoDataReader adobe commerceReader;
adobe commerceReader = adobe commerceCommand.ExecuteReader();
// Always call Read before accessing data.
while (adobe commerceReader.Read()) {
Console.WriteLine(adobe commerceReader.GetString(0) + ", " + adobe commerceReader.GetString(1));
}
// always call Close when done reading.
adobe commerceReader.Close();
// Close the connection when done with it.
adobe commerceConnection.Close();
} |
|
|---|
Public Sub ReadMyData(myConnString As String)
Dim mySelectQuery As String = "SELECT customer_id, lastname FROM Customers"
Dim adobe commerceConnection As New MagentoConnection(myConnString)
Dim adobe commerceCommand As New MagentoCommand(mySelectQuery, adobe commerceConnection)
adobe commerceConnection.Open()
Dim adobe commerceReader As MagentoDataReader
adobe commerceReader = adobe commerceCommand.ExecuteReader()
' Always call Read before accessing data.
While adobe commerceReader.Read()
Console.WriteLine(adobe commerceReader.GetString(0) + ", " _
+ adobe commerceReader.GetString(1))
End While
' always call Close when done reading.
adobe commerceReader.Close()
' Close the connection when done with it.
adobe commerceConnection.Close()
End Sub |