QueryRecordCountException Class
Describes an error that is raised during record count request process.
The sample shows a catch block that is defined to catch a QueryRecordCountException exception.
// Create a command selecting all records from the Dept table.
Devart.Data.PostgreSql.PgSqlCommand command = new Devart.Data.PostgreSql.PgSqlCommand("select * from Dept");
try
{
// Execution of the command will fail as no connection is set to it.
command.GetRecordCount();
}
catch (QueryRecordCountException ex)
{
// Use the InnerException property to determine the actual error occurred.
Console.WriteLine("An error occurred while counting records in the result set: "
+ ex.InnerException.Message);
}
' Create a command selecting all records from the Dept table.
Dim command = New Devart.Data.PostgreSql.PgSqlCommand("select * from Dept")
Try
' Execution of the command will fail as no connection is set to it.
command.GetRecordCount()
Catch ex As QueryRecordCountException
' Use the InnerException property to determine the actual error occurred.
Console.WriteLine("An error occurred while counting records in the result set: " _
+ ex.InnerException.Message)
End Try
System.Object
System.Exception
Devart.Common.QueryRecordCountException