Click or drag to resize

DatabaseDBCount Method (String, String, String, DataFuncOptions, String, Int32)

Returns the number of items in the specified column and table using the SQL WHERE clause supplied. Note: For improved performance use DBExists(String, String, DataFuncOptions, String) when possible.

Namespace:  NetQuarry
Assembly:  EAP.Core (in EAP.Core.dll) Version: 2.0.0.0 (4.6.8.0)
Syntax
public int DBCount(
	string column,
	string table,
	string where,
	DataFuncOptions options,
	string logSource,
	int commandTimeout
)

Parameters

column
Type: SystemString
The name of the column from which to retrieve the value.
table
Type: SystemString
The name of the table from which to retrieve the value.
where
Type: SystemString
Filter criteria for which records to retrieve.
options
Type: NetQuarryDataFuncOptions
Option flags affecting the operation.
logSource
Type: SystemString
The source of the operation, to be logged to the devlog.
commandTimeout
Type: SystemInt32
The command timeout in seconds (overriding system default).

Return Value

Type: Int32
The number of matching records.

Implements

IDatabaseDBCount(String, String, String, DataFuncOptions, String, Int32)
Examples
C#
// Lookup the first customer with a CompanyName that starts with Alfreds and print the value
object    val = db.DBLookup("CompanyName", "Customers", "CompanyName LIKE 'Alfreds%'");        
Console.WriteLine(val.ToString());

// Write the number of customers
Console.WriteLine(db.DBCount("*", "Customers", ""));
See Also