I am new to ASP.net (I have been building the main applications for about 2 weeks) and am amazed at the big problem with my databases.
I created a simple email application with a login system. A few days ago everything worked perfectly.
But for some reason, every time I try to access the database file with my programs, getting the following error:
* Server error in application "/". The database file may be corrupted. Run the recovery 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. View the stack trace for more information about the error and its occurrence in the code. Exception Details: System.Data.SqlServerCe.SqlCeException: The database file may be corrupted. Run the recovery 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 in each database. Wether I use a database that worked in the past, or just created a new empty db.
I get the feeling that this problem has nothing to do with db corruption, but with another problem that I am facing:
When I have my local database connected in the server explorer, I can add tables - populate the tables with data, the test connection will always be successful. when I try to connect to the database through my program:
* Exception Details: System.Data.SqlServerCe.SqlCeException: file access violation exists. Another way might use a file. [C: \ Users \ ArvinAsus \ Documents \ Visual Studio 2010 \ Projects \ mailer \ App_Data \ Database.mdf] *
Then I close the connection in the server explorer and the error disappears, leaving an error with an error.
I am completely stuck with this. Anyone who has an idea to turn me on again?
early.
PS: Im using Visual Studio 2010 Professional
Arvin source share