本文介绍了如何在visual studio 2012中将“用户实例”设置为本地数据库的“true”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I am trying to set the 'user instance' to 'true' of local database in Visual Studio 2012 as it is needed in making the project as .exe, however, when I try to modify the connection, it gives me an error like: 

'The user instance login flag is not allowed when connecting to a user instance of SQL Server. The connection will be closed.'





我尝试过:





What I have tried:

Here is the connection string:

    `SqlConnection sql = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Karen Kate\Documents\DateRangeTest.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True;Context Connection=False");`

推荐答案


这篇关于如何在visual studio 2012中将“用户实例”设置为本地数据库的“true”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 22:09