2016-06-23 76 views
0
<connectionStrings> 
    <add name="ConnectionString" 
       connectionString="Data source = YOUR DATA SOURCE NAME; 
       Initial Catalog=YOUR DATABASE NAME; 
       Integrated security=true;" 
       providerName="System.Data.SqlClient"/> 
</connectionStrings> 

我遇到了問題。該代碼要求我在mvc4中替換數據庫名稱。無法在mvc中找到數據庫名稱和源數據名稱3

我可以在哪裏找到您的數據源名稱和您的數據庫名稱?

我的數據庫連接字符串的名字是:

Data Source (LocalDB)\v11.0;AttachDbFilename="C:\Users\hasibk\Documents\Visual Studio 2012\Projects\try7\try7\App_Data\Database1.mdf";Integrated Security=True;MultipleActiveResultSets=True;Application Name=EntityFramework 

數據庫名稱爲 C:\USERS\HASIBK\DOCUMENTS\VISUAL STUDIO 2012\PROJECTS\TRY7\TRY7\APP_DATA\DATABASE1.MDF

回答

0
<connectionStrings> 
<add name="ConnectionString" 
      connectionString="Data source = (LocalDB)\v11.0; 
      Initial Catalog=Database1; 
      Integrated security=true;" 
      providerName="System.Data.SqlClient"/>