Showing posts with label everytime. Show all posts
Showing posts with label everytime. Show all posts

Saturday, February 25, 2012

ASPNETDB.MDF: The process cannot access the file because it is being used by another proce

Hi,

I'm trying to upload the ASPNETDB.MDF file to a hosting server via FTP, and everytime when it was uploaded half way(40% or 50%)

I would get an error message saying:

"550 ASPNETDB.MDF: The process cannot access the file because it is being used by another process"

and then the upload failed.

I'm using SQL Express. Does anybody know what's the cause?

Thanks a lot

It is because there are some users who are accessing the database through your web application. When the database is in process you cannot replace it. If you want to upload you need to make sure that no one is accessing your application. ASP.NET provides an easy way to disconnect all the clients to your web application with app_offline.htm file

Just create a simple html file with name app_offline. First upload this file to the web root of your application. Once this file was placed into the root directory, all clients will be disconnected and you can make some quick changes like replacing files etc, and after you finish replacing the files, delete the app_offline.htm file from the root.

You can also display a friend message in the app_offline like "Site under maintenance"

app_offline.htm file:

<html>
<body>
Site under maintenance!
</body>
</html>

Thanks

Friday, February 24, 2012

aspnet_regsql

Hi,

It seems everytime I create a new project, I have to run aspnet_regsql to map the database to my application, otherwise, there'll be errors when trying to connect to SQL in my application. My question is, is this a norm? To be executing this procedure everytime I create a web application?

bump, anyone?

|||

Hi,

In your project, if you want to create a Microsoft SQL Server database for use by the SQL Server providers in ASP.NET, you have to use that tool to access that database in your SqlServer. My suggestion is once you use that tool, make a copy of the database which built by that tool as a sample database and stored in your SqlServer. In the furture if you want to get a new database for use by SqlServer providers in ASP.NET. Just create a new empty database and import the structure from the sample one.

Thanks.