question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to use sqlServer in Sample19?

See original GitHub issue

I want to use sqlServer in Sample19,So I change the appsettings.json: “ConnectionStrings”: { “SqlServer”: “Data Source=.;Integrated Security=SSPI;Initial Catalog=MyTest;” }, and in the fold of Sample19 ,I run the cmd as : SET EF_CONNECTIONSTRING=“Data Source=.;Integrated Security=SSPI;Initial Catalog=MyTest;” dotnet ef database update --context ElsaContext
and I got the wrong msg:

System.ArgumentException: Keyword not supported: ‘"data source’. at Microsoft.Data.Common.DbConnectionOptions.ParseInternal(Dictionary2 parsetable, String connectionString, Boolean buildChain, Dictionary2 synonyms, Boolean firstKey) at Microsoft.Data.Common.DbConnectionOptions…ctor(String connectionString, Dictionary2 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.Diagnostics.RelationalLoggerExtensions.MigrateUsingConnection(IDiagnosticsLogger1 diagnostics, IMigrator migrator, IRelationalConnection connection) at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration) at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType) at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabaseImpl(String targetMigration, 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: ‘"data source’.

so ,How to use sqlServer in the example? thanks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:19 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
zsanhongcommented, Nov 26, 2019

please add a sqlServer example,thank!

1reaction
TarekSalhacommented, Jan 25, 2021

Hi guys, for all lonely souls building the ef core migration using vscode and powershell instead of cmd: You need to interchange the SET EF_CONNECTIONSTRING command with $env:EF_CONNECTIONSTRING="Server=localhost;Database=Elsa;User=sa;Password=Secret_password123!;"

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connect and query a SQL Server instance using ...
Create a database · Right-click your server instance in Object Explorer, and then select New Query: The New Query link · Paste the...
Read more >
Microsoft SQL samples - SQL Server
Follow these instructions to download and install AdventureWorks sample databases to SQL Server using Transact-SQL (T-SQL), SQL Server ...
Read more >
Create a Microsoft SQL Server connection
Once you have created a connection to a Microsoft SQL Server database, you can select data from the available tables and then load...
Read more >
SQL Tutorial
Our SQL tutorial will teach you how to use SQL in: MySQL, SQL Server, MS Access, Oracle, Sybase, Informix, Postgres, and other database...
Read more >
Connect to MS SQL server | DataGrip Documentation
To open SQL Server Configuration Manager, open the Search dialog on Windows and type SQLServerManager15.msc (for Microsoft SQL Server 2019).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found