I installed localdatabase and created a shared instance, and using smo, I can create a local database.
For my requirement, I need to create a shared localdb instance.
I am creating a local database using SMO like this.
ServerConnection serConn = new ServerConnection(@"(localdb)\.\sharedIns"); Server ldbServer = new Server(serConn); Database db = new Database(ldbServer , "databaseName"); db.Create();
Before creating the database, I create a shared instance through the command line using sqllocaldb.exe, like this
c:\>sqllocaldb create testIns c:\>sqllocaldb share testIn sharedIns
I want to remove these steps manually and create a shared localdb instance using SMO. How to do it?
source share