AttachDBFilename

Connectionstring:

connectionString="Data Source=.;AttachDBFilename= aa.mdf;User ID=sa;Password=sa"

AttachDBFilename = ...   //automaticly attach the db

connectionString="Data Source=.;database = aa.mdf;User ID=sa;Password=sa"

database = ...               //manually attach the db

原文地址:https://www.cnblogs.com/greencolor/p/1759106.html