C
C#7mo ago
Sk

i am unable to do "update-database" in EFCore using MVC

this is the info it gives for not being able to do it "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: SNI_PN11, error: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.) ---> System.ComponentModel.Win32Exception (2): The system cannot find the file specified." does anyone have any ideas? i have been following a tutorial and he hasnt done anything that i havent so i dont know why my "update-database" wont work, i have a sql server set up(image 1)
No description
19 Replies
Mayor McCheese
Mayor McCheese7mo ago
Have you connected to sql via ssms or azure data studio?
Sk
Sk7mo ago
ssms this is the error ive got to now:"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) ---> System.ComponentModel.Win32Exception (53): The network path was not found."
Sk
Sk7mo ago
my connection string :" "ConnectionStrings": { "DefaultConnection": "Server=CDRIVETEST;Database=master;Trusted_Connection=True;MultipleActiveResultSets=true" }, "
No description
Sk
Sk7mo ago
No description
Sk
Sk7mo ago
any help would be much appreciated
Kao
Kao7mo ago
Your servername should include what you hid in the screenshot
Sk
Sk7mo ago
changed it now get this one: "A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.)" sorry for all the questions i really appreciate everyones patience even when i ask stupid questions haha
No description
Sk
Sk7mo ago
how can i trust it? is there something i should change?
Kao
Kao7mo ago
I think you can just set trusted_connection to false here Also there are no stupid questions Except the ones that remain unasked and unanswered (Now that does not mean that you should ask every question, it is also important to try and search by yourself sometimes.)
Sk
Sk7mo ago
just tried, still no luck. just says the same error
Sk
Sk7mo ago
No description
Sk
Sk7mo ago
thats the current connection code
Kao
Kao7mo ago
SQL Authority with Pinal Dave
SQL SERVER - Fix - Error - The certificate chain was issued by an a...
ASP.NET Core applications can sometimes result in the error "The certificate chain was issued by an authority that is not trusted."
Mayor McCheese
Mayor McCheese7mo ago
Sorry didn't mean to abandon you, getting ready for a run
Sk
Sk7mo ago
should i try replace "Trusted_Connection=False" with "Integrated Security=True;"
Kao
Kao7mo ago
No Look at the first thing Talking about TrustServerCertificate Also in both case it would not replace things, just a new param And you can revert to Trusted_Connection=True I guess
Sk
Sk7mo ago
IT WORKED OMG OMGGGG THANK YOU BOTH SO MUCH I THINK I WAS TRYING TO FIND A WAY TO MAKE THAT WORK FOR LIKE 5 HOURS STRAIGHT ACROSS ONE DAY THIS IS THE HAPPIEST MOMENT IN MY LIFE no problem! thank you for your help with this problem and all my others today haha tysm. literally a life saver. i actually dont know what i wouldve done if i couldnt get this to work! i wouldve had to find another sql server thing and it wouldve made everything so complex
Kao
Kao7mo ago
All of that is why I don't like SQL Server. Always a pain to get it working For beginners MySQL /MariaDB WAY easier And when you need a better system, PostgreSQL is as good, if not better than SQL server depending on use cases and easier to connect to imo
Sk
Sk7mo ago
i will 100% look into that then haha