다음을 통해 공유


ApplicationDatabaseFileGroup.ApplicationDatabaseFiles Property

Gets the collection of ApplicationDatabaseFile objects in the filegroup.

네임스페이스: Microsoft.SqlServer.Management.Nmo
어셈블리: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

구문

‘선언
Public ReadOnly Property ApplicationDatabaseFiles As ApplicationDatabaseFileCollection
public ApplicationDatabaseFileCollection ApplicationDatabaseFiles { get; }
public:
property ApplicationDatabaseFileCollection^ ApplicationDatabaseFiles {
    ApplicationDatabaseFileCollection^ get ();
}
/** @property */
public ApplicationDatabaseFileCollection get_ApplicationDatabaseFiles ()
public function get ApplicationDatabaseFiles () : ApplicationDatabaseFileCollection

속성 값

The ApplicationDatabaseFileCollection object for the filegroup.

주의

Each filegroup can contain one or more database files. Use this property to get the collection of database files. Use the methods of the ApplicationDatabaseFileCollection class to add and remove database files.

After you deploy the application, you cannot add or delete database files. If you need to alter the database after deployment, use the Microsoft SQL Server tools, such as SQL Server Management Studio.

The following examples show how to define an application database file and then use this property to add it to the ApplicationDatabaseFileCollection:

// Define and add a filegroup
ApplicationDatabaseFileGroup adb_fg = 
    new ApplicationDatabaseFileGroup(adb, "PRIMARY");
adb.ApplicationDatabaseFileGroups.Add(adb_fg);

// Define and add a database file
ApplicationDatabaseFile adb_file1 = 
    new ApplicationDatabaseFile(adb_fg, "MyApp_PrimaryFile1");
adb_file1.FileName = @"C:\NS\Full\MyApp_PrimaryFile1.mdf";
adb_file1.InitialSize = "10MB";
adb_file1.MaxSize = "50MB";
adb_file1.GrowthIncrement = "10%";
adb_fg.ApplicationDatabaseFiles.Add(adb_file1);
' Define and add a filegroup
Dim adb_fg As ApplicationDatabaseFileGroup = _
    New ApplicationDatabaseFileGroup(adb, "PRIMARY")
adb.ApplicationDatabaseFileGroups.Add(adb_fg)

' Define and add a database file
Dim adb_file1 As ApplicationDatabaseFile = _
    New ApplicationDatabaseFile(adb_fg, "MyApp_PrimaryFile1")
adb_file1.FileName = "C:\NS\Full\MyApp_PrimaryFile1.mdf"
adb_file1.InitialSize = "10MB"
adb_file1.MaxSize = "50MB"
adb_file1.GrowthIncrement = "10%"
adb_fg.ApplicationDatabaseFiles.Add(adb_file1)

스레드 보안

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

플랫폼

개발 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

대상 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

참고 항목

참조

ApplicationDatabaseFileGroup Class
ApplicationDatabaseFileGroup Members
Microsoft.SqlServer.Management.Nmo Namespace

관련 자료

응용 프로그램 데이터베이스 정의
NamedFileGroup Element (ADF)
FileSpec Element (ADF)
CREATE DATABASE(Transact-SQL)