I have installed localdatabase and created a shared instance, and using smo I am able to create localdatabase.
For my requirement I have to create a localdb shared instance.
I am creating 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 database, I am creating shared instance through command prompt using sqllocaldb.exe like this
c:\>sqllocaldb create testIns
c:\>sqllocaldb share testIn sharedIns
I want to remove these manual steps and create localdb shared instance using SMO. How to do this?