Hi,
I have a project that has two applications and a database on a SQL Server.
A client application is to sit on networked PC and the other server app with the database will sit on a server. (note: the two apps do not talk to each other and use the database independently).
All was well and I was nearly finished so I have been looking at what I need to do to deploy the solution After reading some information I added the database to the server application’s project in VS2005 with the intention of using the server application install program create the database. The problem is now I can’t access the database outside of the Visual Studio project.
SQL Server Manager can't access it, Toad for SQL can't access it or my Client PC application which all worked fine before I added the database to the server app project.
The action of adding the database to the project seems to have caused the database to be copied to the application project folder. The original mdf file is still in the MS SQL Server folder in program files but I can’t connect to it and I can’t see the new mdf file as SQL server can’t see them.
When I try to attach the original DB file in the MS SQL Server folder in program files using SQL Management studio I get the following message
If I try to attach to the new copied mdf file in the application project folder using SQL Management studio I get this error
Please help if you have any ideas of how to either revert this back or get access to the new database file in the application project directory.
Cheers,
Kevin
I have a project that has two applications and a database on a SQL Server.
A client application is to sit on networked PC and the other server app with the database will sit on a server. (note: the two apps do not talk to each other and use the database independently).
All was well and I was nearly finished so I have been looking at what I need to do to deploy the solution After reading some information I added the database to the server application’s project in VS2005 with the intention of using the server application install program create the database. The problem is now I can’t access the database outside of the Visual Studio project.
SQL Server Manager can't access it, Toad for SQL can't access it or my Client PC application which all worked fine before I added the database to the server app project.
The action of adding the database to the project seems to have caused the database to be copied to the application project folder. The original mdf file is still in the MS SQL Server folder in program files but I can’t connect to it and I can’t see the new mdf file as SQL server can’t see them.
When I try to attach the original DB file in the MS SQL Server folder in program files using SQL Management studio I get the following message
Code:
TITLE: Microsoft SQL Server Management Studio Express
------------------------------
Failed to retrieve data for this request. (Microsoft.SqlServer.Express.SmoEnum)
For help, click: [URL unfurl="true"]http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476[/URL]
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo)
------------------------------
CREATE FILE encountered operating system error 32(The process cannot access the file because it is being used by another process.) while attempting to open or create the physical file 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\CDEvolution.mdf'. (Microsoft SQL Server, Error: 5123)
For help, click: [URL unfurl="true"]http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=08.00.0760&EvtSrc=MSSQLServer&EvtID=5123&LinkId=20476[/URL]
------------------------------
BUTTONS:
OK
------------------------------
If I try to attach to the new copied mdf file in the application project folder using SQL Management studio I get this error
Code:
TITLE: Microsoft SQL Server Management Studio Express
------------------------------
Attach database failed for Server 'PCIT2'. (Microsoft.SqlServer.Express.Smo)
For help, click: [URL unfurl="true"]http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476[/URL]
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo)
------------------------------
Could not find row in sysindexes for database ID 7, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.
Could not open new database 'C:\PCIT\CD.NET 2005\SCHEDULEDTASKS\DBRUN\DBRUN\UPDATEDB\CDEVOLUTION.MDF'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 602)
For help, click: [URL unfurl="true"]http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=602&LinkId=20476[/URL]
------------------------------
BUTTONS:
OK
------------------------------
Please help if you have any ideas of how to either revert this back or get access to the new database file in the application project directory.
Cheers,
Kevin