就是关于微软各种版本的数据库连接字符串的XML格式,还有连接字符串的每个关键字的解释,单击 Connection String Examples -->LocalDB Connection String Example,就跳转到 “LocalDB Connection String Example”部分的内容,而且下面还有如下提示:“For more information about connection string settings, see Data Source, AttachDbFileName, Initial Catalog, Integrated Security, andMultipleActiveResultSets later in this topic.”
我现在终于明白了Initial Catalog等各个关键字的官方、准确、权威的定义 了!!,
即:Initial Catalog (synonym: Database) initial catalog 在有道词典里查询也是“数据库”的意思;
Integrated Security (synonym: Trusted_Connection):信任链接,有三种赋值:True False SSPI (Security Support Provider Interface) ,具体解释你参照上述链接,下文有相关提示:“You have to use integrated security when you use LocalDB or the AttachDBFileName option. Otherwise,”。
MultipleActiveResultSets: (MARS) option makes it possible to execute multiple queries simultaneously. 具体参见上述网址的解释。
注意当你使用localdb的时候,你添加到web.config里面的链接字符串的名字,必须和你的Model里面的MovieDBContext相同!!( name of the connection string must match the name of the DbContext class.),如链接字符串如下:
<add name="MovieDBContext" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Movies.mdf;Integrated Security=True" providerName="System.Data.SqlClient" />
The LocalDB setup program uses the SqlLocalDB.msi program to install the necessary files on the computer. Once installed, LocalDB is an instance of SQL Server Express that can create and open SQL Server databases. The system database files for the database are stored in the users' local AppData path which is normally hidden. For example C:\Users\<user>\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\LocalDBApp1\. User database files are stored where the user designates, typically somewhere in the C:\Users\<user>\Documents\ folder.
For more information about including LocalDB in an application, see the Visual Studio documentation Local Data Overview, Walkthrough: Creating a SQL Server LocalDB Database, and Walkthrough: Connecting to Data in a SQL Server LocalDB Database (Windows Forms).