Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

database does not appear in sql server management studio

$
0
0

Hi,

I'm new to SQL server and want to try it. To do this, i use VSC 2013 (C#, .net4.5, ADO) and i installed SQL Express 2014 on a PC Under W8.1pro. I succeeded to create and access a database with my application. My database is created with a code like:

using(var connection =newSystem.Data.SqlClient.SqlConnection("Data Source=(local); Integrated Security=true;User Instance=True;")){
	connection.Open();using(var command = connection.CreateCommand()){
		command.CommandText=String.Format("CREATE DATABASE {0} ON PRIMARY (NAME={0}, FILENAME='{1}')", dataBaseName, dbFileName );
		command.ExecuteNonQuery();

		command.CommandText=String.Format("EXEC sp_detach_db '{0}', 'true'", dataBaseName );
		command.ExecuteNonQuery();}}

My problem is to manage this database with "Microsoft SQL Server Management Studio"; i fact, i never succeeded to see my database in this tool. The .mdf file of my databae is located in a directory "C:\Users\myuseraccount\Documents\SQLServerExpDBs\". I tried to join my mdf file, but MSqlSMS refuse to display the content of all my user account directories.

Someone can explain how to manage such DB in MSqlSMS?

thanks in advance

Pascal


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>