C
C#

✅ DB Error

✅ DB Error

CCoderMN11/19/2023
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
PPixxelKick11/19/2023
Looks like your OutputDir param got mangled
Pphaseshift11/19/2023
I thought the context arg was the problem
PPixxelKick11/19/2023
Is there supposed to be a space between Models\DataLayer and -ContextMMABooksContext?
Pphaseshift11/19/2023
Like -Context is smushed to the value
PPixxelKick11/19/2023
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
CCoderMN11/19/2023
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
JJP11/19/2023
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
PPixxelKick11/19/2023
Parameters here start with -
CCoderMN11/19/2023
Wow that did it
PPixxelKick11/19/2023
So there should be a space before the -
CCoderMN11/19/2023
I didn't see that original comment Thank you!

Looking for more? Join the community!

C
C#

✅ DB Error

Join Server
Want results from more Discord servers?
Add your server
Recommended 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%Assistance regarding deciding on what to use.Hello there, I want to port one of my macOS apps to a native windows app and would like to ask which✅ C# SMS/MMS BotI have a project I'm working on I have a working PBX that receives SMS and MMS messages to a web conHelp 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 Can't access object attributes using X.PagedListI have a search field that returns a list of movies. It works fine if I reference the model as @MoviTryin to install scriptscs but cinst is not a recognized commandI'm trying to install scriptcs but cinst isn't a recognized command. I have uninstalled and reinstalHow do I utilize Identity Framework and AspNetUser Table?Hello, I am building an MVC app where people will need to sign up. They can then upload stuff to th✅ Is there a way to run a commands method inside of another command? (DSharpPlus)Title explains it. ```c# #region RandomImage [SlashCommand("randomimage", "Visa en rhelpGood evening, I have a monolithic application completed, can someone help me migrate a monolithic apProject structure (MVC API, microservice arch.)https://github.com/classy-giraffe/BookshopHow can I insert my sortedlist into a listbox?I am new to C# and currently using a sortedlist<string, int> in order to store values that I need toHow to map Entity Framework entities containing circular references to DTOs?When querying data with Entity Framework, the result data appears to contain circular references. (