-
Notifications
You must be signed in to change notification settings - Fork 2
ObjectData
Darren Comeau edited this page Oct 16, 2018
·
1 revision
Retrieve all rows of data from the table or view.
public DataTable ObjectData(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 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.
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);Intended for use with tables and views only.