Hi,
I created new tenant which should run on different database - but does not work.
How should the connection string look like? Like Server=localhost; Database=MyDatabase; Trusted_Connection=True;MultipleActiveResultSets=True;Encrypt=True;TrustServerCertificate=True;Connection Timeout=30;
?
Thanks Oliver
8 Answer(s)
-
0
-
0
Hi @pliaspzero
You can use the ConnectionString used by your active application with a different Database name. By default, it has this structure in the application, you can use it by changing the name.
Server=localhost; Database=YourTenantDb; Trusted_Connection=True; TrustServerCertificate=True;Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi,
I did it like this - but didn't work - any other idea?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @pliaspzero
When you create a Tenant in this way, do you get an error? If so, can you share the error with us and if there is any error output in the log? If no error occurs, can you check if a database is created with the name you gave in the relevant SQL Server?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi, I tried to connect with existing database - didn't work. - Now I created new database - there is an timeout on creation- Microsoft.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Task has been aborted, but create of the database 'WFMOneDbPLI2' may continue in the background. Please check whether the create has finished successfully.
Operation cancelled by user.
---> System.ComponentModel.Win32Exception (258): The wait operation timed out.
at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at Microsoft.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean isAsync, Int32 timeout, Boolean asyncWrite)
at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IEnumerable`1 migrationCommands, IRelationalConnection connection)
at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.Create()
at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade databaseFacade)
at Abp.Zero.EntityFrameworkCore.AbpZeroDbMigrator
1.CreateOrMigrate(AbpTenantBase tenant, Action1 ...Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @pliaspzero
Can you edit the Connect Timeout setting for your database and try again? You can give this value in the Connection string here? Related Document
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi, with new database - it worked now. How can I connect successfully to existing database?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @pliaspzero
If you want to use the database you specified instead of the Host database in the relevant tenant, you can connect to the previously created database. It will be sufficient to specify the connection string of the database you previously created. Here, when Tenant saves, it migrates the tables related to the tenant. If you are experiencing the same problem, you can increase the Connect Timeout or Command Timeout value. These values may be necessary during the migration for the server server.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)
