.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

C# Database created but does not show up in Server Management Studio unless I manually attach it.

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :Sql Server

I used C# Linq to Sql to create a database. I look on the hard drive and the database .mdf and .ldf files are there. I open Server Management Studio 2008, attach to SQL express and the database is not there unless I actually attach the database.


First, is this correct behavior?

Second, is it possible to create a Sql Express database that is automatically registered(?) in Management Studio? If so, please give pointer.


Thanks very much.



View Complete Post

More Related Resource Links

Problem trying to attach database file to Microsoft SQL Server Management Studio

I was trying to attach a database to SQL Server MGT Studio and got an exception error.  The message stated that the database file I was trying to attach could not be opened because it was version 661.  The SQL Server shows to support version 655 and earlier.  It states that a downgrade path is not supported. Question:  Is there some download ; fix; I can make to SQL Server 2008 that will allow me to attach the version 661????  I am not technical at all.  Please speak slowly.  :)  Thanks

Can't attach my project database (.mdf file) using SQL Server Management Studio R2

Hi.  I've encountered a strange issue in SQL Server Management Studio (not the express version).  I had to uninstall SQL Server 2008 Developer in order to install SQL Server 2008 R2 Developer.  As a result of doing this, the database from one of my ASP.NET MVC projects is not attached to the database server.  I see the ".mdf" file in my project's AppData folder in Windows Explorer, but I can't navigate to it in SQL Server Management Studio.  I go to "C:\Users\<my name>" and the attach database interface will not let me go any further.  The folder that I need to access is "C:\Users\<my name>\Documents\Visual Studio 2010\NerdDinner\NerdDinner\App_Data".  How can I access this directory from SQL Server Management Studio?  Is there some sort of strange permission issue?  Thanks in advance for any help.

Cannot Create Database Diagrams - SQL Server 2008 Management Studio

I cannot create a database diagram with my client-side SQL Server Management Studio.  I can do this if I am on the actual db server itself.  Please help.

SQL Server Management Studio is not attaching a database.

Hi folks,I'm a newbie in development, and i'm facing a grave concern here.  Sql Server Management Studio (2008) does not seem to be able to attach  a database that i've already created in Sql Server 2005 express within my ASP.NET application.  When I try to attach the database, by clicking "Attach" after right clicking the Database note in object explorer, I get to see a dialog box with an Add button.  I then click that button, and try to navigate to the database, and I'm simply not able to reach that folder!!! The folder containing the databse physically exists, but i can't see it when i'm trying to browse to it.This is a Windows 7 (home edition) laptop, with VS 2008.Can someone please help me here???Thanks!

SQL Server Management Studio cannot locate my database

I had to uninstall SQL Server 08 when I left my last project, I have reinstalled the management studio but it no longer recognizes the databases that are on my local machine.  How can I reconcile the connection to the preexisting databases?  When I choose connect, nothing comes up in the options and when i type in the database name it errors out.  I thought it was just that the old files were corrupt but I installed a brand new database and while i can verify that it exists on my machine, I cannot connect through Management Studio.

how to connect my hosting database from my pc using sql server management studio 2005



I have one asp.net hosting account with some service provider.. 

They have given me some xxx.xxxxxx.com to access sql server from my desktop... 

I enter xxx.xxxxx.com in server name and username and password but it will not connect.. 

so please let me know what are the steps i have to do to access my hosting database...

they have given sql server 2008 im using in local sql server 2005 management studio so let me know how to connect

thanks in advance

Microsoft SQL Server Management Studio 2008 does not list all tables in database

When logging into SSMS 2008 to a SQL2008 database when I expand the tables in a database I only see a few tables listed.  I can login to the same instance with SSMS 2005 and all of the tables are there.  Is there a reason why this is this way?

I can do a select * from in a query window for any of the tables in the database via SSMS 2008 as well and it work fine.  It just does not display the tables.

set up database with .bak files in SAL server management studio



I need to connect to 3 remote databases from my local machine and  restore 3 .bak files, one for each database.

I am new to asp and sql server and am finding SQL Server Management studio quite confusing.  I cannot find any options to connect remotely or restore a database from .bak.

Many thanks

SQL Server 2008 Management Studio - "Show policy health state for all nodes"

What does "Show policy health state for all nodes" option do in SQL Server 2008 under the Object Explorer?

Screen Shot

SQL Server Management studio - cannot show requested dialog NColIndex




I've just bought a 64 bit system running Windows Server 2008 and SQL Server 2008.


I wa shaving trouble getting the backups to work so I thought I'd better attached a database so that there was something a bit more meaty to copy.

However when I try to attach a database file I get the message


SQL Server Management Studio

Cannot show requested Dialog


Actual value was -1 (Microsoft.SQLServer.GridControl)


I'm logged in to SQL as SA


Am I doing something wrong here?


Can anyone advise me what to try next?








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,

Failed to create new database in SQL Server Management Studio Express



I don't know why I can't create a new database in SQL Server Management Studio Express.



This is the reason:


CREATE DATABASE permission denied in database 'master'. (.Net SqlClient Data Provider)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.3042&EvtSrc=MSSQLServer&EvtID=262&LinkId=20476

Server Name: Ning-PC\SQLEXPRESS
Error Number: 262
Severity: 14
State: 1
Line Number: 1

Program Location:

   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndW

Create table in the database using management studio


 I have database already on the server. However, when I created new table, the new created table Schema is not dbo. it is my user name. How to solve this?

It shows the new created table Schema is my username but not dbo.

Even though I rename it, it couldn't change. I can see this in table property.



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?

SQL Server Management Studio


Hi folks


Am sorry if this mght be abit silly question am a Novice Developer.

If am using Visual Studio 2008 Pro, Do I need SQL Server Management Studio? or is it included in the VS 2008 Pro Suite? Am learning C# and SQL Server.



How to connect to local instance of SQL Server 2008 Management Studio Express ?


I just installed SQL Server 2008 Management studio Express on my Vista machine.

i tried connecting to local machine using :

.\sqlexpress, (local)\sqlexpress, or .\SQLExpress, MyPCNAME\SQLExpress

nothing is working, getting this error:

Cannot connect to PC-NAME\SQLEXPRESS. 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

SQL Server Management Studio Slow Grid Draw and Refresh

I've istalled SQL2005/SSMS on my development machine and connecting to a local SQL Server 2005. Executing queries is fast but the results grid populating is slow and so is the refresh of the same data. This is not a slow query, its the gridview draw/redraw. I've other PC's with slower processors and less ram with the same software run circles around the SMSS Performance on this Laptop   I've read posts about nvidia graphics drivers and mouse drivers causing issues similar to this. I do have an nvidia quadro x1600M (this is a laptop Compaq 8710w) and switching off the accelerator using Displays/Advanced/Troubleshooting by moving the slider to the middle/center position causes the gird refresh to dramatically increase. It's funny how turning oof the accelerator increases performance.   I have the latest HP nvidia drivers and SSMS is useable without hardware acceleration  but I also develop software that uses directx and its getting really troublesome to work this way.   I am running:   Operating System: Windows XP Professional (5.1, Build 2600) Service Pack 2 (2600.xpsp_sp2_qfe.070227-2300)Language: English (Regional Setting: English)System Manufacturer: Hewlett-PackardSystem Model: HP Compaq 8710wBIOS: EPP runtime BIOS - Version 1.1 Processor: Intel(R) Core(TM)2 Duo CPU     T7300  @ 2.00GHz (2 CPUs)Memory: 3072MB RAMPage File: 515MB used, 4439MB availableWindows Dir: C:\WIN
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