I was given an alredy made project, I don't know if it is code or db first.
My problem is that when I try to remove row from one table or from some other one, it tells me there is a reference with other table and it can't delete them.
I can delete them from the db just fine so there must be something locking them in the code. If someone can give me any tip on where to look it would be helpfull, thank you !
Here is a screen shot of my code:
Here is a screen shot of my database structure:
Related
I am using visual studio with sql server, i am in a middle of a practice and faced a major issue.
The issue was in the first place, when i was creating a product table , by mistake i mistyped as a categoryId ctegoryId, and later i recorrected it by thinking its over.
And now I am almost done with the identity scaffolding when updating my database, I am facing such an error. and I've tried all ways to update it by myself but failed.
I need an expert guidance so I can continue my path till the end.
I do appreciate any solution from your side.
Thanks indeed [Migration error "Each Table must be unique"](https://i.stack.imgur.com/tB3iT.png)
Just to let you know, I have deleted my migration and reinstalled again without[NotMapped]in my product table"categoryID" and it worked back normally.
I'm pretty new to MVC. I've built an EDMX, successfully created the models and am now trying to go through scaffolding to build a controller. The first thing I notice is that in the Model Class dropdown, I have duplicates:
Now, "BillysRentals2" is the name of the project. I don't know where those extras are coming from or where these "Model classes" are stored. It's true I've had to re-do the adding of the ADO.NET Entity thing several times, but even after I completely delete the EDMX and all its contents, some of those model classes still remain, so which are the real ones and where are the others hiding? It's confusing when you create "Model" and you're seeing "Model1" and stuff popping up.
But the second problem is that once I select a class, and press OK, I get this beautiful gem:
And yes, I tried removing the EDMX completely, doing a Re-build, removing and re-adding connections, Rebuilding again, and I'm still getting that message. What's wrong? I'm sure the fact that I'm getting multiple entries above means that there are bits and pieces of my previous efforts lying around someplace that are confusing MVC (not that it's hard to do) but how do I find them and get rid of them to start over?
And P.S. what is the difference anyway between a model class and a data context class?
I had several metadata files leftover from the last time, which had field names that I didn't import this time around.
The template comes without database at first. When I launch the application some code must create the db obviously, because I check the appData folder and now it's there.
Can you tell me which part of the code creates it? Thanks. I have long looked at the code and I cannot figure it out.
I think the only answer possible is that entity framework creates the database automatically. But the strange thing is if I remove thee database it does not get recreated, I get an error that says it's missing it.
I have a cube in SSAS that work well. I access the cube via Excel/connection and create a pivot table.
But when I add one new specific dimension into it I am having problem:
As soon as that new dimension is in the cube, I can still create a new connection to it, but when I close the file and reopen it I got the following message:
"Excel encountered unreadable content in [filename.xlsx]."
Then the connection doesn't work anymore and the pivottable is empty, we have to recreate the connection and the pivot table... all working well until we close the file.
I tested it and the issu is only there when I add that dimension.
Since the error message is useless and I can't figure out what is the cause of the problem, I am asking you guys.
Any idea what it could be ?
Do you have a list of things to check?
Any help would be appreciate, thank you
I removed one by one the column/attribute from the dimension to see if and what attribute is causing the issue and I found it and removed it, even if I do not understand why it is cause an issue.
I am using the Advanced Menu for Orchard, I have alot of duplicated content to add to multiple menus so was trying to do this directly into the database.
The problem I had was when I add items to the database the items don't show up and the CMS breaks and doesn't allow items to be added (this causes a duplicate primary key error).
Can anyone tell me why this is, and what I would need to do if I wanted to add entries manually?
Not knowing how you've tried to add them, it's hard to say. Maybe you've created part records without content item records, making them orphans? But again, I'm just guessing, as I have no idea what you tried to do.
For manual entries you might be better off using the command line utility. see http://www.orchardproject.net/docs/Using-the-command-line-interface.ashx
Or the import/export functionality (which I think just runs the command line stuff)
If yo want to know more follow piotr's blog. It's full of great stuff!
http://www.szmyd.com.pl/