在檔案 C:\Users\user\Desktop\Real\App_Data\product.mdf 附加自動命名的資料庫之嘗試失敗。相同名稱的資料庫已經存在、無法開啟指定的檔案或者它位於 UNC 共用中。
描述: 在執行目前 Web 要求的過程中發生未處理的例外情形。請檢閱堆疊追蹤以取得錯誤的詳細資訊,以及在程式碼中產生的位置。例外詳細資訊: System.Data.SqlClient.SqlException: 在檔案 C:\Users\user\Desktop\Real\App_Data\product.mdf 附加自動命名的資料庫之嘗試失敗。相同名稱的資料庫已經存在、無法開啟指定的檔案或者它位於 UNC 共用中。原始程式錯誤:行 62:
行 63: objConnection = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\product.mdf;Integrated Security=True;User Instance=True");
行 64: objConnection.Open();
行 65:
行 66: objCommand = new SqlCommand(sql, objConnection);可以怎解決,謝謝
描述: 在執行目前 Web 要求的過程中發生未處理的例外情形。請檢閱堆疊追蹤以取得錯誤的詳細資訊,以及在程式碼中產生的位置。例外詳細資訊: System.Data.SqlClient.SqlException: 在檔案 C:\Users\user\Desktop\Real\App_Data\product.mdf 附加自動命名的資料庫之嘗試失敗。相同名稱的資料庫已經存在、無法開啟指定的檔案或者它位於 UNC 共用中。原始程式錯誤:行 62:
行 63: objConnection = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\product.mdf;Integrated Security=True;User Instance=True");
行 64: objConnection.Open();
行 65:
行 66: objCommand = new SqlCommand(sql, objConnection);可以怎解決,謝謝
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货