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: , , , .

New feature of Visual Studio 2008 Convert String Array to Long Array

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Recent Posts

Feeds


Follow

Get every new post delivered to your Inbox.