我在Linq-to-SQL連接中遇到了一些問題,我開發了一個使用Linq-to-SQL的桌面應用程序,因爲我已經使用了基於服務的本地數據庫,並且爲此應用程序創建了一個設置,將.mdf
文件放入我的安裝項目,我現在的問題是,當我創建的設置和其他電腦上安裝它,然後它會告訴我的錯誤一樣運行時數據庫連接期間的連接問題。
BA network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)lockquote
我的連接字符串是
connectionString="AttachDbFilename=|DataDirectory|\DailyExpense.mdf;
Integrated Security=True;User Instance=True"
那臺電腦是否還安裝了SqlExpress? – 2012-07-20 12:40:42
是的,如果SqlExpress安裝,那麼它給我同樣的錯誤。 – 2012-07-20 12:47:40
是否需要在使用.mdf文件時安裝客戶端SqlExpress? – 2012-07-20 12:48:28