Friday, March 30, 2012

Reporting services and existing application

Hello everyone I have a small application in asp.net now I'm trying to use the SQL reporting services. But as soon as I try to connect to the DB on the "connection properties" window I get this error.

Unable to open the physical file "C:\my\Apps\mydb.mdf". Operating system error 32: "32(The file is in use by another process.)".

\

Thanks

Looks like you are using SQLExpress and in your web site, web.config file you are directly attaching a dbf file, so it is getting used by ASP.NET worker process. But again you are trying to access it through reporting services, which is another process. So that is why you are getting this exception.

Try to modify your connection string, instead of AttachDB file name, build a proper connection string to SQL Express

|||

I change my connection string to:

<connectionStrings>
<add name="DBCSCompany" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=true;Database=C:\Inetpub\wwwroot\apps\App_Data\Database.mdf" />
</connectionStrings>

but I still get the same error

|||

Hi,

First, be sure that the physical path of the mdvb file is correct, I suggest that you shoud put your mdf file in app_code directory. so you can use "AttachDBFilename=|DataDirectory|someMdfFile"to locate the mdf file.

Second, when this problem occurred, just to check if other program is using the mdf file. Such as Visual Studio developpment server. If so, turn it off and try again.

Thank.

No comments:

Post a Comment