Kaprice
asked on
Error deleting field in Visual Studio 2013 mdf
I created a Linq to Sql class and an dbml from a LocalDB mdf.
I want to delete a field from the database.
I get this error:
The field is a text field. Is not part of any relationships. But, does have an index. I get the same error when only trying to delete the index.
I've deleted the field from the dbml diagram but still get the error.
How do I find and remove the reference that's causing this error?
I want to delete a field from the database.
I get this error:
Update cannot proceed due to validation errors.
Please correct the following errors and try again.
SQL71501 :: Index: [dbo].[MemberPanTickets].[MemberPanT ickets$Ide ntifiers] has an unresolved reference to Column [dbo].[MemberPanTickets].[ Location].
The field is a text field. Is not part of any relationships. But, does have an index. I get the same error when only trying to delete the index.
I've deleted the field from the dbml diagram but still get the error.
How do I find and remove the reference that's causing this error?
LINQ to SQL is a dying breed. I found myself deleting the DBML, and recreating it again. You should look at Entity Framework 6, because it is a living system, and a more mature product.
ASKER
Thanks for the tip on EF, Bob. I was really tempted to go that way, but I'm still new to VS and read that EF is more complicated than LinqToSql and since this is a fairly simple data structure, I wanted to reduce the amount of new stuff I had to learn. But, it's good to know that LinqToSql is outdated. I'll focus on EF for my next project.
ASKER
Randy, I'll give that a try and report back. Thanks for the tip.
ASKER
Randy, I've gone through the thread you linked to and I'm confused.
It appears this process creates a script for creating a copy of the database. Is that right? How does that help me drop a field? And, what do I do with the script once it's generated?
It appears this process creates a script for creating a copy of the database. Is that right? How does that help me drop a field? And, what do I do with the script once it's generated?
ASKER
Bob, are you certain my error is due to dbml?
I am not 100% certain, but it feels like there is a mess of plumbing that is generated, that you would need to find. If you have heavily customized the data context, then I don't think that you would want to re-generate.
One suggestion would be to backup all the files related to the DBML file, delete them, and then re-generate.
One suggestion would be to backup all the files related to the DBML file, delete them, and then re-generate.
ASKER
Bob, I get the error when trying to drop a field from the database (LocalDB). You're saying the error is because my dbml has a reference that's blocking VS from processing it?
No, I thought you had an error with the data context for LINQ to SQL, not the local database. Are you trying to use Code First with LINQ to SQL (from Entity Framework)?
If not, what are you using to delete the column from the table?
If not, what are you using to delete the column from the table?
ASKER
No, not Code First.
I'm using Visual Studio Data Connections in Server Explorer.
I'm using Visual Studio Data Connections in Server Explorer.
OK, is the column that you need to delete part of a relationship? If so, then you need to delete that relationship first.
ASKER
I appreciate your help, but if you'll re-read my OP, you'll get a better understanding of the situation.
Heck, that misunderstanding happens after answering so many questions...
I have no idea why this is happening, but I am willing to help you find a solution. What is the order of operations for the delete? Are you deleting the index, before the column?
I have no idea why this is happening, but I am willing to help you find a solution. What is the order of operations for the delete? Are you deleting the index, before the column?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I would suggest marking your own comment as the correct answer.
ASKER
Thanks again for all your efforts.
ASKER
Solution found and listed.
Open in new window