LocalDB Instance is Corrupted

Recently, I was working on the ASP.NET MVC 5 Application. The MVC 5 application uses the LocalDB database as a default database. You can also check it out on the web.config file that in the connection string the data source is the LocalDB v 11.0.

Well, sometimes it may be possible that, your localdb instance corrupted and when you run the application and while performing the database operations like registering a new user you can get the following exception:

LocalDb Exception in MVC 5

Solution

I have searched for this exception and when I saw in the event log of windows application that there is an error which states that : "Your LocalDB instance is corrupted". Now, I have the solution for this exception.

As the error states that : The LocalDB instance is corrupted. So you have to follow the procedure given below to solve this problem:

Step 1: Open the Command Prompt as "Run as Administrator"

Step 2: The SQL LocalDB is situated at the following location:

"C:\Program Files\Microsoft SQL Server\110\Tools\Binn" 

LocaDb File Location

Step 3: In the command prompt, go to the file location of LocalDB

LocalDb File Location in cmd

Step 4: Perform the following operations:

LocalDb Operation

That's it. Now, I successfully perform the operations on the LocalDB database. Happy Coding!!

Ebook Download
View all
Learn
View all