Im fairly new to ASP.net (making basic applications for about 2 weeks), and im struck by a big problem with my databases.
I was building a simple email application, with a login system. Everything was working just fine a few days ago.
But somehow, everytime i try to access a database file with my programs im getting the following error:
*Server Error in '/' Application. The database file may be corrupted. Run the repair utility to check the database file. [ Database name = C:\Users\ArvinAsus\Documents\Visual Studio 2010\Projects\mailer\App_Data\Database.mdf ] Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlServerCe.SqlCeException: The database file may be corrupted. Run the repair utility to check the database file. [ Database name = C:\Users\ArvinAsus\Documents\Visual Studio 2010\Projects\mailer\App_Data\Database.mdf ]*
This error is always displayed with every database. Wether i use a database that worked in the past or just create a new empty db.
Im having the feeling that this problem has nothing to do with db corruption but with another problem i am having:
When i have my local database connected in the server explorer, i am able to add tables - fill tables with data, test connection always succeeds. when i try to connect to the database through my program :
*Exception Details: System.Data.SqlServerCe.SqlCeException: There is a file sharing violation. A different process might be using the file. [ C:\Users\ArvinAsus\Documents\Visual Studio 2010\Projects\mailer\App_Data\Database.mdf ]*
I then close the connection in the server explorer, and the error vanishes, leaving me with the corruption error.
I am completely stuck with this. Anybody with an idea to get me going again?
thanks in advance.
PS: Im using Visual Studio 2010 Professional