Skip to content

ObjectData

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

ObjectData(String, String)

Retrieve all rows of data from the table or view.

Overloads

public DataTable ObjectData(string schemaName, string objectName);

ObjectData(string schemaName, string tableName)

Parameters

schemaName String

The database schema which hosts the object.

objectName String

The name of the database table or view which we should retrieve data from.

Returns

DataTable

One table object returned containing all rows and columns in the specified SQL object.

Exceptions

ObjectNotFound

Couldn't find the database object you were trying to retrieve data from.

Examples

Retrieve all the data held in 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 ObjectData method
var schemaName = "dbo";
var objectName = "TestPerson";

// Call the ObjectData method to delete all rows
var tableContent = tester.ObjectData(schemaName, objectName);

Remarks

Intended for use with tables and views only.

Clone this wiki locally