C
C#13mo ago
macskabenzin

Planetscale with .Net

Hi, I am learning C#. I would like to connect a simple console app to a Planetscale DB. I am using Entity Framework's boilerplate code. My Context file contains this code snippet (username & password starred-out of course) I know it's a bad practice to add the connection string like this, but it's just a plain learning test from my side. protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseSqlServer( "Server=aws.connect.psdb.cloud;Database=blazor-blog;user=bla-bla;password=bla-bla;" ); } I have managed to create the migrate files with the Add-Migration InitialCreate command. This is the error I got: PM> Update-Database Build started... Build succeeded. Microsoft.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) Does anyone can help me out with this? Thank you in advance!
1 Reply
macskabenzin
macskabenzinOP13mo ago
It turned out EF's SQL server is a wrong package to handle Planetscale. Planetscale is a MySQL DB. And handling MySQL requires different depedency.
Want results from more Discord servers?
Add your server