C
C#6mo 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
Jimmacle6mo ago
have you looked at the MS documentation? there are lots of examples there
LycRicks
LycRicks6mo ago
can you throw it
LycRicks
LycRicks6mo 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
Jimmacle6mo ago
it depends on your server
LycRicks
LycRicks6mo ago
I don't understand
Jimmacle
Jimmacle6mo ago
do you have a SQL server?
LycRicks
LycRicks6mo ago
yes
Jimmacle
Jimmacle6mo ago
and how do you authenticate with it?
LycRicks
LycRicks6mo ago
I don't know how to do it, in the examples it always uses local data.
Jimmacle
Jimmacle6mo ago
i'm not talking about the examples i'm asking you how you access your sql server right now
LycRicks
LycRicks6mo ago
1 min
Jimmacle
Jimmacle6mo ago
my point is, you're going to use the same server address and username/password in your connection string
LycRicks
LycRicks6mo ago
I can connect from here But I don't know how to write it as string
Jimmacle
Jimmacle6mo ago
have you looked up any examples?
LycRicks
LycRicks6mo ago
I tried this but it didn't work
Jimmacle
Jimmacle6mo ago
you just leaked your SA password you should delete that image
LycRicks
LycRicks6mo ago
In the examples I looked at, they always use local data.
Jimmacle
Jimmacle6mo ago
like seriously delete it immediately
LycRicks
LycRicks6mo ago
No problem, I can change
Jimmacle
Jimmacle6mo 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
LycRicks6mo ago
server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;
Jimmacle
Jimmacle6mo ago
yes
LycRicks
LycRicks6mo 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
More Posts
A NuGet package broke my WPF codeJust after I downloaded NuGet package called IronQR my entire code broke and it says IntitializeCompDiscord BotI started writing a Discord bot as of yesterday. The bot works and gives no errors, but it does not Generic Method Type Parameter to create DbSet for my Database query?I want to make my code reusable by passing a type parameter to a generic method and using that paramCompile .NET project with nuget packages Visual StudioI want to create .DLL file out of dotnet project, but it uses some Nuget dependencies, which I wouldtetromino is phasing through my grid in unityits alot of stuff so i will just post a reddit link here where I put my infomation https://www.reddiHow to assign roles to already created Users in ASP.NET Identity?In ASP.NET I am trying to attribute Roles to specific users in my Database, I already have the users✅ how do I read a json file, edit it and save the edit in the json file?lets say we have a json file here: ```json { "meow" : 2 }``` 3 things Im wondering how to do(code bIs there a standard option to generate UUID version 7? (Guid)Hello, .NET provides a way to generate UUID v4 with `Guid.NewGuid()`, but this cannot be used as a What is the up-to-date version of AspNet.WebAPI?I am upgrading my console application to include Web Api, so i changed the sdk from `Microsoft.NET.S[WPF] How to edit multiple items in ListBox at onceI'm trying to edit multiple items using SelectionMode="Extended" to give the items a specific value,