title: Connecting to MSSQL Server developer edition with visual studio and entity framework core 5.0.2
body: <p>I downloaded a AdentureWorks2019.bak, and restored it in SQL Server Management Studio. When I try scaffolding in Visual Studio 2019 with the following command:</p>
  <pre><code>Scaffold-DbContext 'Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=AdventureWorks;Trusted Connection=True;'  Microsoft.EntityFrameworkCore.SqlServer
  </code></pre>
  <p>I get the following warning:</p>
  <blockquote>
  <p>To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see <a href="https://go.microsoft.com/fwlink/?linkid=2131148" rel="nofollow noreferrer">https://go.microsoft.com/fwlink/?linkid=2131148</a>. For more guidance on storing connection strings, see <a href="http://go.microsoft.com/fwlink/?LinkId=723263" rel="nofollow noreferrer">http://go.microsoft.com/fwlink/?LinkId=723263</a>.</p>
  </blockquote>
  <p>And then the following error:</p>
  <pre><code> PM&gt; Scaffold-DbContext 'Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=AdventureWorks;Trusted Connection=True;'  Microsoft.EntityFrameworkCore.SqlServer
  Build started...
  Build succeeded.
  To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
  System.ArgumentException: Keyword not supported: 'trusted connection'.
     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&amp; 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.Scaffolding.Internal.SqlServerDatabaseModelFactory.Create(String connectionString, DatabaseModelFactoryOptions options)
     at Microsoft.EntityFrameworkCore.Scaffolding.Internal.ReverseEngineerScaffolder.ScaffoldModel(String connectionString, DatabaseModelFactoryOptions databaseOptions, ModelReverseEngineerOptions modelOptions, ModelCodeGenerationOptions codeOptions)
     at Microsoft.EntityFrameworkCore.Design.Internal.DatabaseOperations.ScaffoldContext(String provider, String connectionString, String outputDir, String outputContextDir, String dbContextClassName, IEnumerable`1 schemas, IEnumerable`1 tables, String modelNamespace, String contextNamespace, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames, Boolean suppressOnConfiguring, Boolean noPluralize)
     at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContextImpl(String provider, String connectionString, String outputDir, String outputDbContextDir, String dbContextClassName, IEnumerable`1 schemaFilters, IEnumerable`1 tableFilters, String modelNamespace, String contextNamespace, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames, Boolean suppressOnConfiguring, Boolean noPluarlize)
     at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContext.&lt;&gt;c__DisplayClass0_0.&lt;.ctor&gt;b__0()
     at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.&lt;&gt;c__DisplayClass3_0`1.&lt;Execute&gt;b__0()
     at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
  Keyword not supported: 'trusted connection'.
  </code></pre>
  <p>I have tried searching searching for a solution, but with no luck. I would be more than thankful if someone could help!</p>