AMO Fundamental Classes
Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).
Fundamental classes are the starting point for working with Analysis Management Objects (AMO). Through these classes you establish your environment for the rest of the objects that will be used in your application. Fundamental classes include the following objects: Server, Database, DataSource, and DataSourceView.
The following illustration shows the relationship of the classes that are explained in this topic.
This topic contains the following sections:
Additionally, you will have access to the following methods:
Connection management: Connect, Disconnect, Reconnect, and GetConnectionState.
Transaction management: BeginTransaction, CommitTransaction, and RollbackTransaction.
Backup and Restore.
DDL execution: Execute, CancelCommand, SendXmlaRequest, StartXmlaRequest.
Metadata management: UpdateObjects and Validate.
To connect to a server, you need a standard connection string, as used in ADOMD.NET and OLEDB. For more information, see ConnectionString. The name of the server can be specified as a connection string without having to use a connection string format.
To work with a Database object in your application, you must get an instance of the database from the parent server databases collection. To create a database, you add a Database object to a server databases collection and update the new instance to the server. To delete a database, you drop the Database object by using its own Drop method.
Data sources are managed by using the DataSourceCollection from the database class. An instance of DataSource can be created by using the Add method from a DataSourceCollection object. An instance of DataSource can be deleted by using the Remove method from a DataSourceCollection object.