다음을 통해 공유


FileGroup 생성자 (Database, String, Boolean)

지정한 데이터베이스에서 지정한 이름을 가진 FileGroup 클래스의 새 인스턴스를 초기화합니다. 선택적으로 FILESTREAM 파일 그룹을 만들 수 있도록 합니다.

네임스페이스:  Microsoft.SqlServer.Management.Smo
어셈블리:  Microsoft.SqlServer.Smo(Microsoft.SqlServer.Smo.dll)

구문

‘선언
Public Sub New ( _
    database As Database, _
    name As String, _
    isFileStream As Boolean _
)
‘사용 방법
Dim database As Database
Dim name As String
Dim isFileStream As Boolean

Dim instance As New FileGroup(database, _
    name, isFileStream)
public FileGroup(
    Database database,
    string name,
    bool isFileStream
)
public:
FileGroup(
    Database^ database, 
    String^ name, 
    bool isFileStream
)
new : 
        database:Database * 
        name:string * 
        isFileStream:bool -> FileGroup
public function FileGroup(
    database : Database, 
    name : String, 
    isFileStream : boolean
)

매개 변수

  • isFileStream
    유형: System. . :: . .Boolean
    Boolean 값입니다. true이면 FILESTREAM 유형의 파일 그룹을 만들 수 있도록 인스턴스가 초기화됩니다.

Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Management.Smo

Module Module1

    Sub Main()
        'Connect to the local, default instance of SQL Server. 
        Dim svr As New Server()

        'Define a Database object instance by supplying the server 
        'and the database name arguments in the constructor. 
        Dim db As New Database(svr, "MyPhotos")

        'Create the database on the instance of SQL Server. 
        db.Create()

        'Define a FileGroup object instance for creation of FILESTREAM 
        'groups by supplying the database, group name, and supplying 
        'true for the isFileStream parameters. 

        Dim myFileGroup As New FileGroup(db, "MyPhotoGroup", True)

        If myFileGroup.IsFileStream = True Then
            Console.WriteLine("MyPhotoGroup is enabled for the creation of a FILESTREAM file group.")
        End If

        'Remove the database to clean up. 
        db.Drop()

    End Sub
End Module
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Management.Smo;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            //Connect to the local, default instance of SQL Server.
            Server svr = new Server();

            //Define a Database object instance by supplying the server
            //and the database name arguments in the constructor.
            Database db = new Database(svr, "MyPhotos");

            //Create the database on the instance of SQL Server.
            db.Create();

            //Define a FileGroup object instance for creation of FILESTREAM
            //groups by supplying the database, group name, and supplying
            //true for the isFileStream parameters.

            FileGroup myFileGroup = new FileGroup(db, "MyPhotoGroup", true);

            if (myFileGroup.IsFileStream == true)
                Console.WriteLine("MyPhotoGroup is enabled for the creation of a FILESTREAM file group.");

            //Remove the database to clean up.
            db.Drop();
        }
    }
}