.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

unable to attach database, security setting?

Posted By:      Posted Date: August 24, 2010    Points: 0   Category :ASP.Net

Hi folks,

I am using VS 2010 Professional with SQL Server 2008 Developer.  I right click on the App_Data folder in solution explorer and add an existing item, then navigate to the correct database.  However, I receive a pop up that Access is Denied.  How do I fix this? 

View Complete Post

More Related Resource Links

unable to attach database

Unable to attach Database (SQL Express 2005):DATABASE-->When supposed to add new database by click right button of the mouse,clicking 'Attach and in window 'Attach Databse' when I click 'ADD' Button : I receive error: Failed to retrive data for this request.(MS.SqlServer.Express.SmoEnum) Additional Information: Failed to connect to Server .....(MS.Sqlserver.express.connectionInfo)   PLEASE HELP.    

Unable to attach database in sql server 2008




I have Windows Vista Home Premium and the 180 day evaluation version of SQL Server 2008 installed.

I am getting the following error when trying to attach the AdventureWorks2008 database. I was able to attach the Northwind:

TITLE: Microsoft SQL Server Management Studio

Attach database failed for Server 'HOME-PC'.  (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.0.1600.22+((SQL_PreRelease).080709-1414+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476


An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)


FILESTREAM feature is disabled.
A file activation error occurred. The physical file name 'C:\Program Files\Microsoft SQL Server\MSSQL10.M

Unable to attach database using Management Studio



Hi,  I have installed SQL Express 2008 on a Windows XP SP2 box. SQL Server 2005 is also on this box (installed as part of another program).


When I try to attach a database using Management Studio I get the following error:



Cannot show requested dialog.


Parameter name: nColIndex
Actual value was -1. (Microsoft.SqlServer.GridControl)

Program Location:

   at Microsoft.SqlServer.Management.UI.Grid.GridControl.SetColumnWidthInternal(Int32 nColIndex, GridColumnWidthType widthType, Int32 nWidth)
   at Microsoft.SqlServer.Management.UI.Grid.GridControl.SetColumnWidthInternalForPublic(Int32 nColIndex, GridColumnWidthType widthType, Int32 nWidth)
   at Microsoft.SqlServer.Management.UI.Grid.GridControl.SetColumnWidth(Int32 nColIndex, GridColumnWidthType widthType, Int32 nWidth)
   at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.SetGridColumnWidth(SqlManagerUIDlgGrid grid, Double[] columnWidthRatio,

Exception Error 5123 - Unable to attach database




Our GIS group is working with SQL Server 2005 in conjunction with ESRI's ArcGIS software. SQL Server is being used as a test bed until we formally migrate our existing Microsoft Access mdb's over. So, at this time we are conducting various tests and have the freedom to "blow up" our databases.


We are currently testing ArcSDE Workgroup edition, which will only work with SQL Server Express (SSE). SSE will let us create spatial joins and relationships, while maintaining data integrity. So one possible workaround was to detach the database from SQL Server 2005 and then attach it to SSE. Unfortunately, we ran into a problem in re-attaching the database back to SQL Server 2005.


The exact steps are as follows:

  1. Back up database using back up tool in SQL Server 2005.
  2. Detached database from SQL Server 2005.
  3. Attached database to SQL Server Express (hereafter SSE).
  4. Created a table in database while it was attached to SSE.
  5. Detached database from SSE.
  6. Attempt to attach database to SQL Server 2005 failed
  7. Succe

Asp.net web site security database


Hello all, I'm new to asp.net and I'm currently practising some few stuffs. I'm creating a hotel reservation system using ASP.net Web site in visual studio 2008 and I currently don't have an App_Data in my solution explorer unlike visual web developer.

1. I have planned to make users of the website login before making their reservations.

2. I have also planned to develop the website such that I will be able to know all reservations made by each user.

First and formost, I will like to know how I can access/View the security database?

Secondly, how do I link my custom made reservation database and the security database in order to achieve my second plan above.?

Someone help me.

Thank you.

Unable to make connection to database?


Hy guys. I try to connect my database for so long so i wrote two type of codes. Let's discuse first on.

I have database called PhoneDirectory.

It have only one table named Residents.

I have button wiht ID="Button1".

I want when i click this button to see all of my residents. 

I want to see the result in DetailsView and to be able to edin, delete and add new resident.

First try with SqlDataSource so i wrote this:

<asp:SqlDataSource ID="Resident Details" runat="server" ProviderName="System.Data.SqlClient" ConnectionStrings="<%$ ConnectionStrings:ThisIsTheConnection%>" 
              SelectCommand = "SELECT * FROM Resident "

unable to connect to database



I am using visual studio 2005 and sql server 2005.

I am developing a small quiz application and i have stored the connection string in app.config file which is given below.:

<?xml version="1.0" encoding="utf-8" ?>
        <add name="quizdb"
            connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|Quiz Application.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
            providerName="System.Data.SqlClient" />
i have retrieved connection string property through configurationmanager class 

and when i m connecting to database  it gives me a runtime error:


Sql Exception was unhandled

System.Data.SqlClient.SqlException was unhandled
  Message="An attempt to attach an auto-named database for file F:\\Quiz\\Quiz\\bin\\Debug\\Quiz Application.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located

cannot attach database from server explorer


Hello all,

In Server Management Studio, I am attempting to attach a database.  After selecting the database in the wizard

I receive an error: This file is in use, Enter a new name or close the file that's open in another program. 

I don't have SSMS open, and have restarted the computer to make sure the memory is cleared.  Not sure what to try next.  Any ideas?

Detach/Attach database question

I recently restored a database from SQL7 to SQL2005.  When restoring the database I needed to create a c:\data\data folder or else it would not restore the mdf and ldf files. I would like to move these files to a new location.  Copied the the two files to a new folder, C:\database.  Using the sql studio manager, preformed a task to detach the database, then attach the database with the new location. This seemed to work, I am able to access my application that uses this database.  However, any changes I make to the program, are not writing changes back to the mdf file.  When I open the program, these changes are still in place, but the mdf file should be updated, correct?  When the database files were stored in the c:\data\data folder, any little change I made to the program changed the modified time for the mdf file. Is there something missing or where could these changes be written to?

Unable to install SP3 on SQL 2005 due to Database Services language being blank

Hi all,   I have an issue that requires me to upgrade to a later SP (currently on RTM), but when I try to install SP3 Database Services cannot be ticked. Upon inspection I see that its reporting "This update requires language ENU.  The language for this product instance MSSQLSERVER is . Download the upadte for langage .", when I check teh Language field to the right it is blank, other parts however are fine and can be upgraded. Can you advise please as I don't know how to manually set the language (which is reported inside SQL itself as English (United Kingdom)) and I cannot un/reinstall. Thanks, John

attach sample database failed in sql 2008 express RTM

I'm having a trouble attaching sample database northwnd database,screen show me the error attach database failed for server 'computername\sqlexpress' additional inforamtion: the database 'northwind' cannot be opended because it is version 661.this server supports version 655 and earlier.a downgrade path is not supported.could not open new database 'northwind',create database is aborted,()microsoft sql server,error:948) my os is xp sp3,sql express version is  Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (Intel X86)   Jul  9 2008 14:43:34   Copyright (c) 1988-2008 Microsoft Corporation  Express Edition with Advanced Services on Windows NT 5.1 <X86> (Build 2600: Service Pack 3)  I 'm sure database 'northwind' is ok.I can used database 'northwind' on my other computer.the other computer install express 2008R2 .    install RTM computer  ,database route is C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS,not C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data. actually I 'm install sample database in sql express RTM on my computer.I just wonder why attach good database failed,how to solved this issue. http://sqlserversamples.codeplex.com/releases/view/45923 this link is avialable   thanks for you help

Reporting Services Add-In for MOSS2007 : Unable to connect to the database Error at "Set Server Defa

Dear Expert, I've succesfully install the Add-In + configure the reporting services (integrated mode) + activate the features on my MOSS2007. As we know by activating this at my Central Admin, i'm able to see "Reporting Services" under my Application Management as below:   1) Manage Integration Setting   ---> My report url : http://servername:808/ReportServer (Trusted Account) 2) Grand Database Access --->  My setting : <servername> with default instance  3) Set Server Defaults ---> Area that i receive an error "Unable to connect to database" Anybody here have a same experience? please assist me, Thanks in Advanced My Note: OS : Windows Server 2008 Enterprise x64bit (SP2) SQL : SQL 2005 with latest Service Pack (SP3)  My Error Log: <Header>   <Product>Microsoft SQL Server Reporting Services Version 9.00.4035.00</Product>   <Locale>en-US</Locale>   <TimeZone>Malay Peninsula Standard Time</TimeZone>   <Path>c:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\LogFiles\ReportServer__08_04_2010_10_51_59.log</Path>   <SystemName>SEINE</SystemName>   <OSName>Microsoft Windows NT 6.0.6002 Service Pack 2</OSName>   <OSVersion>6.0.6002.131072</OS

Unable to upload/attach any file

We have a developing Sharepoint server with SQL Seerver 2005 standard as a db server. Eventually server stopped to accept uploading any file into any library or attaching to any list item on all application poolls and site collections. What I've checked so far: server does have anough disk space.So any idea where else to look for somthing broken/corrupted?Here is the message we getting: The URL 'WebPartTesting/LOB1.xml' is invalid.  It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web.   at Microsoft.SharePoint.Library.SPRequestInternalClass.PutFile(String bstrUrl, String bstrWebRelativeUrl, Object varFile, PutFileOpt PutFileOpt, String bstrCreatedBy, String bstrModifiedBy, Int32 iCreatedByID, Int32 iModifiedByID, Object varTimeCreated, Object varTimeLastModified, Object varProperties, String bstrCheckinComment, UInt32& pdwVirusCheckStatus, String& pVirusCheckMessage)    at Microsoft.SharePoint.Library.SPRequest.PutFile(String bstrUrl, String bstrWebRelativeUrl, Object varFile, PutFileOpt PutFileOpt, String bstrCreatedBy, String bstrModifiedBy, Int32 iCreatedByID, Int32 iModifiedByID, Object varTimeCreated, Object varTimeLastModified, Object varProperties, String bstrCheckinComment, UInt32& pdwVirusCheckStatus, String& pVirusCheckMessage) The problem appear

unable to connect to a database engine

Hi. i have recently installed SQll Server 2005 but i am facing issue while connecting to a databse engine..how should i do it..?its showing an error which looks like this TITLE: Connect to Database Engine ------------------------------ Cannot connect to sanchit. ------------------------------ ADDITIONAL INFORMATION: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=53&LinkId=20476 please assist me in this....

Cannot crawl sharepoint site and mysite after database attach upgrade form sharepoint 2007 to 2010.

After database attach upgrade site and mysite from sharepoint 2007 to 2010 , I have full crawl and get "The crawler could not communicate with the server. Check that the server is available and that the firewall access is configured correctly. If the repository was temporarily unavailable, an incremental crawl will fix this error. ( Error from SharePoint site: HttpStatusCode ServiceUnavailable The request failed with HTTP status 503: Service Unavailable. )" for mysite and get "Access is denied. Verify that either the Default Content Access Account has access to this repository, or add a crawl rule to crawl this repository. If the repository being crawled is a SharePoint repository, verify that the account you are using has "Full Read" permissions on the SharePoint Web Application being crawled." for sharepoint site. The content access account for search is "db_owner" of both of site and mysite. How do I solved this problem ?

Security problem with cross database chaining and stored procedures

I have a situation whereby ProcA exists on database A, but ProcA executes about 20 stored procedures scattered across different databases. To further complicate matters some procs that ProcA calls also call other procs in other databases, this then presents the problem of cross database chaining where you can’t really write to a database from a proc that resides in another database. I am wondering how I can get around this problem, I know I can simply let open cross database chaining and the problem will go away, the other option is to create a proxy which is very complicated and wouldn’t work in my environment. Is there any way around the problem.

How to attach distribution database files

Hi  i am new to sql server. when i am exploring replication concepts, i did a small mistake i.e. i have deleted distribution database.after that i realised and try to create a new one but it still points to the old database named as "distribution" which is not available. i didnt take the backup of the database before dropping. But i have mdf and ldf files of the distribution database. so can i use the sp_attach method to add the  mdf and ldf files? or any other way to fix this issue? please help me on resolving this issue Thanks, Rock  
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend