Skip to content

RowCount

Darren Comeau edited this page Oct 9, 2018 · 1 revision

RowCount(String, String)

Retrieve the number of rows in the object.

Overloads

public int RowCount(string schemaName, string objectName);

RowCount(string schemaName, string objectName)

Parameters

schemaName String

The database schema which hosts the object.

objectName String

The name of the database table or view which we should retrieve the row count for.

Examples

Retrieve the row count for a table.

// Setup the Database Tester object using the MS SQL implementation
var connectionstring = @"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=tempdb;Integrated Security=SSPI;";
VulcanAnalytics.DBTester.DatabaseTester tester = new VulcanAnalytics.DBTester.MsSqlDatabaseTester(connectionstring);

// Parameters for RowCount method
var schemaName = "dbo";
var tableName = "TestPerson";

// Call the RowCount method to insert the rows
tester.RowCount(schemaName, tableName);

Remarks

Intended for use with tables and views.

Clone this wiki locally