Monday, March 19, 2012

I can't find the setting.

Hi, I'm completely new to SQL Server and ASP.NET, so please bear with me on my learning curve! I've installed Visual Web Developer Express and SQL Server Express (on the same PC). I then used Web Developer Express to successfully create a new database with a couple of tables in it. So far so good. I then installed SQL Server Management Studio Express on the same PC and tried to connect to my new database. The connection to the SQL Server instance appears to work OK (using Windows Authentication) but I can't see the database I previously created. All I can see are the System Databases. Does anyone know what the solution might be?

Ensure you are really connected to the same SQL Server instance, you could have multiple instances. Ensure you are connecting using the same credentials, your Windows Authenication account may have different permissions than the account used to by Web Developer Express.

Let me know if this does not help

Peter Saddow

|||

Thank you for the feedback. I eventually found out what the problem was: by default, Web Developer Express creates SQL databases which are visible only to the current User Instance. To disable this, you have to set "User Instance = FALSE" on the database connection string. For example, my original connection string was:

Data Source=.\SQLEXPRESS;AttachDbFilename="S:\My Documents\Visual Studio 2005\WebSites\Db1\App_Data\Database.mdf";Integrated Security=True;User Instance=True

By setting User Instance = False, I can now see the database from SQL Server MSE.

|||I came across the same answer you did the only problem is that I may not find the settings file or some way to edit it.

No comments:

Post a Comment