dotnet 8
How can I use MS SQL and Entity Framework in a console application in Dotnet 8? Can someone give an example?
24 Replies
have you looked at the MS documentation?
there are lots of examples there
can you throw it
thx
I found how to do it, but I am not using local data. What kind of connection string should I use to connect to data on a server?
it depends on your server
I don't understand
do you have a SQL server?
yes
and how do you authenticate with it?
I don't know how to do it, in the examples it always uses local data.
i'm not talking about the examples
i'm asking you how you access your sql server right now
1 min
my point is, you're going to use the same server address and username/password in your connection string
I can connect from here
But I don't know how to write it as string
have you looked up any examples?
I tried this but it didn't work
you just leaked your SA password
you should delete that image
In the examples I looked at, they always use local data.
like seriously delete it immediately
No problem, I can change
so when i google "ms sql server connection string" the first result shows me an example just like what you need
did you try that?
server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;
yes
Are you talking about this?
okeyy
thx
I'm trying
How can I solve this?
Trusted_Connection=True;
I think I found it
no, that's not it
yes I found