This example shows you how to build a simple C# SMO Console application using Visual Studio 2005. Follow these steps:
Select File New Project from the Visual Studio 2005 main menu.
Enter a name for the project and specify the location in which to save the project. Click OK.
Right-click References in the Solution Explorer window. Select Add Reference from the context menu.
In the Add Reference dialog box, add a reference to the Microsoft.SqlServer.ConnectionInfo.dll and Microsoft.SqlServer.Smo.dll assemblies.
Click OK to close the dialog box and add the references.
In the Solution Explorer window, right-click the file Program.cs. Select View Code from the context menu.