我在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