'Declaration Public Overrides ReadOnly Property RecordsAffected As Integer
public override int RecordsAffected {get;}
'Declaration Public Overrides ReadOnly Property RecordsAffected As Integer
public override int RecordsAffected {get;}
IsClosed and RecordsAffected are the only properties that you can call after the SqlShimDataReader is closed.
public void ProcessReader (ZohoBooksDataReader ZohoBooksReader) { if (!ZohoBooksReader.IsClosed) { while (ZohoBooksReader.Read()) { for (int i=0;i<ZohoBooksReader.FieldCount;i++) { Console.Write("\t"+ZohoBooksReader[i]); } Console.WriteLine(); } } else { Console.WriteLine("The DataReader is closed. Rows affected in last action: "+ZohoBooksReader.RecordsAffected); } }
Public Sub ProcessReader(ByVal ZohoBooksReader As ZohoBooksDataReader) If Not ZohoBooksReader.IsClosed Then Dim i As Integer While ZohoBooksReader.Read() For i = 0 To ZohoBooksReader.FieldCount - 1 Console.Write(" " & ZohoBooksReader(i)) Next i Console.WriteLine() End While Else Console.WriteLine("The DataReader is closed. Rows affected in last action: " & ZohoBooksReader.RecordsAffected) End If 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