✅ SQL Server issue
Hi friends,
I'm working on an
ASP.NET COre 7 WEB API
project, this project depending on a Sql server
database, using EF Core
.
The Issue:
When I start the API
and try to post a test I get the error shown in the attachments.
But the Sql server is works fine and I can login to it normal (As shown in the attachments)
Additional Info:
SQL Server Version: is SQL Server 2022 Enterprise
Connection String:
The connection string I use in the appSettings.json
is the following :
Windows User
Actually when I installed the windows I didn't created a local user
I directly logged in
to my Microsoft account
.
Please I hope someone to provide a help, because of I get tired from attempting many methods.
Massive thanks in advance13 Replies
your connection string doesn't have any login credentials
you can log into your sql server, but your application can't
Do you have any Idea how do I can fix it Please ?
by giving your application valid credentials to log into your sql server?
I already created a new login and passed its credentials in the connection string but I get the same issue
omg this damn shit will make me
probably a permissions issue on the sql server side then
make sure the login is enabled, allowed to connect, and has permissions on the database you want it to use
I use
Code First
approach, so the database will not created (from migrations) before the logingcode first doesn't create the database, it creates the contents of the database
so
IContacts
should exist as a database but have no tables/etc in itBut what if I want to create a
login
that have all permissions ?what's stopping you from doing that?
Do you have a link that taling about this topic please ?
Guru99
How to Create Login, User and Grant Permissions in SQL Server
In this tutorial, you will learn How to create a user in SQL Server, Create a user using T-SQL, Assigning Permission to a user, and Grant Permissions in SQL
Alright
I will try this solution
@fixed(void* x = &Jimmacle) Massive thanks mate
the issue was fixed
I appreciate