The selected class cannot be deleted because it is used as the return type for one or more DataContext methods.
June 1, 2010 at 7:22 pm Leave a comment
I am back after a looooooooong time.
Today I have faced one problem in dbml file.
As soon as I tried to delete the table from dbml file it gave me below message:
The selected class cannot be deleted because it is used as the return type for one or more DataContext methods.
Any guesses for the error ?
No…
No problem, here is the solution.
The reason of this error is, the table which I was trying to delete is used as a return type of one of the stored procedure in the dbml file.
So, to solve this problem, first delete all the SP in which this table is used as a return type and then delete the table. Now again drag & drop all the Table and all the stored procedure.
Don’t forget to change return type of SP to the table as this might give you error.
Cheers………
Entry filed under: ASP.Net, LINQ. Tags: cannot delete table from dbml, DBML, LINQ, The selected class cannot be deleted because it is used as the return type for one or more DataContext methods..
Trackback this post | Subscribe to the comments via RSS Feed