I have ever seen a user instance function used in conjunction with AttachDbFileName . In other words, you cannot connect to a database that is already connected to a running instance of SQL Server and tell SQL Server to create a new instance for this database, since only one instance can “own” the database for a while. When you use AttachDbFileName , it tells SQL Server to make a copy of this MDF file to use the application.
So, if this is not the way you are going to use this function, I again suggest that you simply take the User Instance = true parameter from your connection string.
(It may also be interesting to note that this dubiously useful feature is deprecated.)
source share