[ad_1]
Comment puis-je résoudre ce problème?
je
PM> Add-Migration cmdlet Add-Migration at command pipeline position 1 Supply values for the following parameters: Name: InitialDatabse Build started... Build succeeded. To undo this action, use Remove-Migration. PM> Update-Database Build started... Build succeeded. System.ArgumentException: Keyword not supported: 'datasource'. at Microsoft.Data.Common.DbConnectionOptions.ParseInternal(Dictionary`2 parsetable, String connectionString, Boolean buildChain, Dictionary`2 synonyms, Boolean firstKey) at Microsoft.Data.Common.DbConnectionOptions..ctor(String connectionString, Dictionary`2 synonyms) at Microsoft.Data.SqlClient.SqlConnectionString..ctor(String connectionString) at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) at Microsoft.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) at Microsoft.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key) at Microsoft.Data.SqlClient.SqlConnection.set_ConnectionString(String value) at Microsoft.Data.SqlClient.SqlConnection..ctor(String connectionString) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerConnection.CreateDbConnection() at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.get_DbConnection() at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.get_DbConnectionState() at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.<>c__DisplayClass18_0.<Exists>b__0(DateTime giveUp) at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.<>c__DisplayClass12_0`2.<Execute>b__0(DbContext c, TState s) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded) at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute[TState,TResult](IExecutionStrategy strategy, TState state, Func`2 operation, Func`2 verifySucceeded) at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute[TState,TResult](IExecutionStrategy strategy, TState state, Func`2 operation) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.Exists(Boolean retryOnNotExists) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.Exists() at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Exists() at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration) at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String connectionString, String contextType) at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabaseImpl(String targetMigration, String connectionString, String contextType) at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c__DisplayClass0_0.<.ctor>b__0() at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action) Keyword not supported: 'datasource'. What I have tried: <pre>I wrote these commands but it was not done successfully in the update section
Solution 1
Il n’y a pas de “source de données” dans une chaîne de connexion SQL – il y a une “source de données”, vous aurez donc peut-être juste besoin d’un espace (mais la plupart des gens utilisent “Serveur” à la place).
Solution 2
PM> Mise à jour de la base de données
La construction a commencé…
Construction réussie.
System.ArgumentException : mot clé non pris en charge : « trusted_conncetion ».
sur Microsoft.Data.Common.DbConnectionOptions.ParseInternal (Dictionary`2 analysable, String connectionString, Boolean buildChain, Dictionary`2 synonymes, Boolean firstKey)
sur Microsoft.Data.Common.DbConnectionOptions..ctor (String connectionString, synonymes Dictionary`2)
sur Microsoft.Data.SqlClient.SqlConnectionString..ctor (String connectionString)
sur Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions (String connectionString, DbConnectionOptions précédent)
sur Microsoft.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup (clé DbConnectionPoolKey, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions et userConnectionOptions)
sur Microsoft.Data.SqlClient.SqlConnection.ConnectionString_Set (clé DbConnectionPoolKey)
sur Microsoft.Data.SqlClient.SqlConnection.set_ConnectionString (valeur de chaîne)
sur Microsoft.Data.SqlClient.SqlConnection..ctor (String connectionString)
sur Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerConnection.CreateDbConnection()
sur Microsoft.EntityFrameworkCore.Storage.RelationalConnection.get_DbConnection()
sur Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open (erreurs booléennes attendues)
sur Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.<>c__DisplayClass18_0.
sur Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.<>c__DisplayClass12_0`2.
sur Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](État TState, opération Func`3, Func`3 verifySucceeded)
sur Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute[TState,TResult](Stratégie IExecutionStrategy, état TState, opération Func`2, Func`2 verifySucceeded)
sur Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.Exists (Boolean retryOnNotExists)
sur Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.Exists()
sur Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Exists()
sur Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate (String targetMigration)
sur Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase (String targetMigration, String connectionString, String contextType)
sur Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabaseImpl (String targetMigration, String connectionString, String contextType)
sur Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c__DisplayClass0_0.<.ctor>b__0()
sur Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute (action d’action)
Mot clé non pris en charge : « trusted_conncetion ».
quel est le problème
[ad_2]
コメント