C
C#11mo ago
LycRicks

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
Jimmacle
Jimmacle11mo ago
have you looked at the MS documentation? there are lots of examples there
LycRicks
LycRicksOP11mo ago
can you throw it
LycRicks
LycRicksOP11mo ago
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?
Jimmacle
Jimmacle11mo ago
it depends on your server
LycRicks
LycRicksOP11mo ago
I don't understand
Jimmacle
Jimmacle11mo ago
do you have a SQL server?
LycRicks
LycRicksOP11mo ago
yes
Jimmacle
Jimmacle11mo ago
and how do you authenticate with it?
LycRicks
LycRicksOP11mo ago
I don't know how to do it, in the examples it always uses local data.
Jimmacle
Jimmacle11mo ago
i'm not talking about the examples i'm asking you how you access your sql server right now
LycRicks
LycRicksOP11mo ago
1 min
Jimmacle
Jimmacle11mo ago
my point is, you're going to use the same server address and username/password in your connection string
LycRicks
LycRicksOP11mo ago
I can connect from here But I don't know how to write it as string
Jimmacle
Jimmacle11mo ago
have you looked up any examples?
LycRicks
LycRicksOP11mo ago
I tried this but it didn't work
Jimmacle
Jimmacle11mo ago
you just leaked your SA password you should delete that image
LycRicks
LycRicksOP11mo ago
In the examples I looked at, they always use local data.
Jimmacle
Jimmacle11mo ago
like seriously delete it immediately
LycRicks
LycRicksOP11mo ago
No problem, I can change
Jimmacle
Jimmacle11mo ago
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?
LycRicks
LycRicksOP11mo ago
server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;
Jimmacle
Jimmacle11mo ago
yes
LycRicks
LycRicksOP11mo ago
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
Want results from more Discord servers?
Add your server