C
C#8mo ago
CoderMN

✅ DB Error

Hey guys, I am working on a project and I am trying to connect it to a DB. I am following the instructions but continue to get this error message even after replacing the original text with the correct DB location. Any thoughts or suggestions would be great! Here is the original text to place in the PMC: Scaffold-DbContext "Data Source=(LocalDB)\MSSQLLocalDB;AttachDBFilename=C:\C#\Database\MMABooks.mdf;Integrated security=True"Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models\DataLayer -ContextMMABooksContext -DataAnnotations –Force
No description
11 Replies
PixxelKick
PixxelKick8mo ago
Looks like your OutputDir param got mangled
phaseshift
phaseshift8mo ago
I thought the context arg was the problem
PixxelKick
PixxelKick8mo ago
Is there supposed to be a space between Models\DataLayer and -ContextMMABooksContext?
phaseshift
phaseshift8mo ago
Like -Context is smushed to the value
PixxelKick
PixxelKick8mo ago
Or should that all be a single "word" Oh yeah that's prolly it This is all overkill BTW Use a startup project that has all the values set Oh wait sorry This is Scaffold not Update, fair enough
CoderMN
CoderMN8mo ago
Scaffold-DbContext –Connection "Data Source=(LocalDB)\MSSQLLocalDB;AttachDBFilename=C:\C#\Database\MMABooks.mdf;Integrated security=True"-Provider Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models\DataLayer-Context MMABooksContext -DataAnnotations –Force This is the other one that they say to use but I am getting the same error This one says it is for sql server exoress lovalDB though
JP
JP8mo ago
run this
Scaffold-DbContext "Data Source=(LocalDB)\MSSQLLocalDB;AttachDBFilename=C:\C#\Database\MMABooks.mdf;Integrated security=True"Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models\DataLayer -Context MMABooksContext -DataAnnotations –Force
Scaffold-DbContext "Data Source=(LocalDB)\MSSQLLocalDB;AttachDBFilename=C:\C#\Database\MMABooks.mdf;Integrated security=True"Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models\DataLayer -Context MMABooksContext -DataAnnotations –Force
PixxelKick
PixxelKick8mo ago
Parameters here start with -
CoderMN
CoderMN8mo ago
Wow that did it
PixxelKick
PixxelKick8mo ago
So there should be a space before the -
CoderMN
CoderMN8mo ago
I didn't see that original comment Thank you!
Want results from more Discord servers?
Add your server
More Posts
Calculate Field Offset Based On Members' NameI'd like to know if the offset calculation is correct. the input used is as follows```cs private coFollowing a video to create power ups, but its not picking them up and I dont know why.Heres the code. I dont know whats wrong with it, from what I can tell its exactly the same as the vConverting int to double to output with decimalsHello again! i got a little problem with converting int to double, i dont get it to output the decimDb ConnectionGood afternoon guys, I need some help setting up the database connection for my project. I have thCan't read property in code behind```cs @page "/weather" @attribute [StreamRendering] <PageTitle>Weather</PageTitle> <h1>Weather</h1RabbitMQ starting service issuePlease guys I had `RabbitMQ` running fine, but after restarting my computer the RabbitMQ won't be stException Unhandled : Could not load file or assembly 'Serilog.Extensions.HostingWhen I run my application, this exception is thrown even before the start of debugging. System.IO.Figot this code that i wrote the get all score and print end score but i didnt read right help meexem is 40% assigments is 30% and participation is 30%Help deciding Next.js/Node.js vs .NET API back-endHello. I really want to use .NET as my API back-end for a practice app I'm building. However, I dohow do i make it so when i press it this happens and if i do it again another thing happensive made a code in winforms so when i press with my left mouse button it hides everything, how do i