Database Constructor ()

Initializes a new instance of the Database class.

Namespace: Microsoft.SqlServer.Management.Smo
Assembly: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Syntax

'Declaration
Public Sub New
public Database ()
public:
Database ()
public Database ()
public function Database ()

Remarks

Updated text:17 July 2006

The default constructor initializes any fields to their default values.

You will need to specify which server is the parent of the database before you can create a database.

This namespace, class, or member is supported only in version 2.0 of the Microsoft .NET Framework.

Example

Dim srv As Server
srv = New Server()

'Create a new database by using the default constructor.
Dim db As Database
db = New Database
db.Name = "New_Database"
db.Parent = srv
db.Create()

Platforms

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

Target Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

See Also

Reference

Database Class
Database Members
Microsoft.SqlServer.Management.Smo Namespace

Other Resources

How to: Create, Alter, and Remove a Database in Visual Basic .NET
Creating, Altering, and Removing Databases
CREATE DATABASE (Transact-SQL)

Change History

Release

History

17 July 2006

Changed content:
  • Added text to the Remarks section.

  • Added code to the Example section.