Missing Assembly Reference .NET 3.5

I am tryng to create some SQL Database objects programmatically using C# in Visual Studio 2008. The "Management" namespace is missing and this is preventing me from accessing the needed classes.  How can I remedy this problem, which I suspect is due to  a problem in the Global Assembly Cache ?

using System;
using System.Data;
using System.Data.SqlClient;
using Microsoft.SqlServer;
using Microsoft.SqlServer.Management.Common
using Microsoft.SqlServer.Management.Smo

namespace ConsoleCreateSqlDataBase
{
    class Program
    {
        static void Main(string[] args)
        {
            string sqlConnectString = "Data Source=(local);" +
                "Integrated security=SSPI;";

            //Use SMO to create database
            Console.WriteLine("--Create Database using SMO--");
            Server server = new Server("(local)");
        }
    }
}

Error      1      The type or namespace name 'Management' does not exist in the namespace 'Microsoft.SqlServer' (are you missing an assembly reference?)
StoutfellowAsked:
Who is Participating?
 
Roopesh ReddyIT AnalystCommented:
Hi,

Check this MSDN article -

http://msdn.microsoft.com/en-us/library/ms162129.aspx

Hope it helps u...
0
 
StoutfellowAuthor Commented:
Thanks roopeshreddy! I had failed to add the needed assembly references to the Solution Explorer (blush).
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.