Gets or sets a string that contains the name of the primary data file. This includes the full path name of an attachable database.
Assembly: System.Data (in System.Data.dll)
This property corresponds to the "AttachDBFilename", "extended properties", and "initial file name" keys within the connection string.
AttachDBFilename is only supported for primary data files with an .mdf extension.
An error will be generated if a log file exists in the same directory as the data file and the 'database' keyword is used when attaching the primary data file. In this case, remove the log file. Once the database is attached, a new log file will be automatically generated based on the physical path.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2