public SqlLibraryConnection CreateSqlLibrary( string server, string databaseName )
Parameters
- server
- Server name.
- databaseName
- The name of the database being created.
Return Value
Connection to the created MS SQL Server library.
public SqlLibraryConnection CreateSqlLibrary( string server, string databaseName )
Exception | Description |
---|---|
EPLAN.Harness.API.Exceptions.HpdApiNotInitializedException | Api is not in an initialized state. You can get current state from Status property. If API is uninitialized, you can initialize it by calling Init(String,String[]) method. If API is in failed state, you can not resurrect it. |
EPLAN.Harness.API.Exceptions.ArgumentException | Argument is invalid. The exception is thrown when a wrong argument is passed to the method or the setter of property. |
EPLAN.Harness.API.Exceptions.ArgumentNullException | Argument is null. |
EPLAN.Harness.API.Exceptions.OperationFailedException | The operation was not successful. |
After this method is called the new MS SQL Server library is only created, not connected.
If connection is required use the ConnectToLibrary(BaseLibraryConnection,String,Boolean) method and pass it the returned library connection.
Library library = Library.GetInstance(); library.CreateSqlLibrary("server", "database name");
Library library = Library.GetInstance(); SqlLibraryConnection connection = library.CreateSqlLibrary("server", "database name"); library.ConnectToLibrary(connection);